/** * Returns a ManagerInterface * * @param integer $timeout Wait timeout for pop * * @return ManagerInterface Returns null if $manager is not a valid ManagerIterface */ protected function getManager($timeout = 0) { try { $manager = $this->connector->pop($this->queue, $timeout); } catch (JobNotFoundException $e) { $this->connector->delete($manager); return false; } catch (QueueEmptyException $e) { return false; } if ($manager instanceof LoggerAwareInterface) { $manager->setLogger($this->logger); } return $manager; }