Last active
November 18, 2017 13:29
-
-
Save kargirwar/4534a83d7c35cc5d750b23cb7bc98336 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
public function run() { | |
while ($this->mWorker->work()) { | |
if ($this->mWorker->returnCode() != GEARMAN_SUCCESS) { | |
throw new \Exception("Fatal Error"); | |
} | |
} | |
} | |
public function report(\GearmanJob $job) { | |
//simulate long running task | |
sleep(1); | |
echo "\nYay!Sent the report to " . $job->workload() . "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment