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 | |
$complete = 0; | |
$fail = 0; | |
$gmc = new GearmanClient; | |
$gmc->addServer(); | |
$gmc->setCompleteCallback(function() use (&$complete) { | |
$complete++; |
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 | |
$gmw = new GearmanWorker(); | |
$gmw->addServer(); | |
$gmw->addFunction('test', function(GearmanJob $job) { | |
throw new Exception('Boom'); | |
}); | |
while(1) $gmw->work(); |
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"; |
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
INFO [ main ] Accepted connection from 127.0.0.1:38684 | |
INFO [ 2 ] Received CON wakeup event | |
DEBUG [ 2 ] Received OPTION_REQ 127.0.0.1:525643377 -> libgearman-server/thread.c:294 | |
DEBUG [ proc ] 'exceptions' -> libgearman-server/server.c:360 | |
DEBUG [ 2 ] Received RUN wakeup event -> libgearman-server/gearmand_thread.cc:409 | |
DEBUG [ 2 ] Sent OPTION_RES to 127.0.0.1:525643377 -> libgearman-server/thread.c:339 | |
DEBUG [ 2 ] Received CAN_DO 127.0.0.1:525643377 -> libgearman-server/thread.c:294 | |
DEBUG [ 2 ] Received GEARMAN_COMMAND_GRAB_JOB_ALL 127.0.0.1:525643377 -> libgearman-server/thread.c:294 | |
DEBUG [ proc ] Jobs available 0 -> libgearman-server/job.c:462 | |
DEBUG [ 2 ] Received RUN wakeup event -> libgearman-server/gearmand_thread.cc:409 |
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 | |
$email = '[email protected]'; | |
$password = 'secret'; | |
$url = "https://www.google.com/accounts/ClientLogin?service=reader&Email={$email}&Passwd={$password}"; | |
$ch = curl_init($url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$output = curl_exec($ch); |
NewerOlder