Example #1
0
 public function testSetAndGetEncrypter()
 {
     $config = $this->mock(ConfigContract::class);
     $manager = new QueueManager($this->mock(ConfigContract::class), $this->mock(ContainerInteropInterface::class), $this->mock(EncrypterContract::class));
     $this->assertInstanceOf(EncrypterContract::class, $manager->getEncrypter());
     $manager->setEncrypter($this->mock(EncrypterContract::class));
     $this->assertInstanceOf(EncrypterContract::class, $manager->getEncrypter());
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function runNextJob(string $connectionName, string $queue = null, int $delay = 0, int $sleep = 3, int $maxTries = 0)
 {
     try {
         $connection = $this->manager->connection($connectionName);
         $job = $this->getNextJob($connection, $queue);
         if ($job !== null) {
             return $this->process($connectionName, $job, $maxTries, $delay);
         }
     } catch (Throwable $exception) {
         if ($this->exceptions) {
             $this->exceptions->report($this->getErrorException($exception));
         }
     }
     $this->sleep($sleep);
 }