Created
August 23, 2011 18:55
-
-
Save laacz/1166129 to your computer and use it in GitHub Desktop.
Jāmet pie malas...
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 | |
$worker= new GearmanWorker(); | |
$worker->addServer('gms'); | |
/* .. whiskas .. */ | |
$worker->addFunction("die", "harikiri"); | |
function harikiri($bushido = false) { | |
static $seppuku = false; | |
$seppuku = $bushido ? true : $seppuku; | |
return $seppuku; | |
} | |
while (!harikiri()) { | |
$worker->work(); | |
if ($worker->returnCode() != GEARMAN_SUCCESS) { | |
harikiri(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment