Created
February 9, 2016 16:53
Revisions
-
Taluu created this gist
Feb 9, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ <?php // snippet class Processor { public function sleep(array $options) { if (null === $options['timeout']) { return $this->processor instanceof SleepyInterface ? $this->processor->sleep($options) : true; } if ((time() - $options['reference']) <= $options['timeout']) { return $this->processor instanceof SleepyInterface ? $this->processor->sleep($options) : true; } $this->logger->info('The process took too long. Killing the consumer...'); return false; } }