Example #1
0
 /**
  * @param Beanie $beanie
  * @param QManConfig $config
  * @param EventLoop $eventLoop
  * @param CommandSerializerInterface $commandSerializer
  * @param JobFailureStrategyInterface $jobFailureStrategy
  * @param ShutdownHandlerInterface $shutdownHandler
  * @param LoggerInterface $logger
  */
 public function __construct(Beanie $beanie, QManConfig $config, EventLoop $eventLoop, CommandSerializerInterface $commandSerializer, JobFailureStrategyInterface $jobFailureStrategy, ShutdownHandlerInterface $shutdownHandler, LoggerInterface $logger)
 {
     $this->logger = $logger;
     $this->config = $config;
     $this->eventLoop = $eventLoop;
     $this->commandSerializer = $commandSerializer;
     $this->jobFailureStrategy = $jobFailureStrategy;
     $this->shutdownHandler = $shutdownHandler;
     $this->eventLoop->setJobListenerRemovedCallback([$this, 'removedJobListenerCallback']);
     $this->eventLoop->setJobReceivedCallback([$this, 'handleJob']);
     $this->beanie = $beanie;
     $this->config->lock();
 }