Created
August 20, 2011 21:35
-
-
Save hjr3/1159694 to your computer and use it in GitHub Desktop.
pecl/gearman client exception callback example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$gmc= new GearmanClient(); | |
$gmc->addServer(); | |
$gmc->setExceptionCallback(function(GearmanTask $task) { | |
$m = $task->data(); | |
echo "Exception: {$m}\n"; | |
return GEARMAN_WORK_EXCEPTION; | |
}); | |
$gmc->addTask('test', 'workload'); | |
$gmc->runTasks(); | |
var_dump($gmc->returnCode()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment