MGDigital\BusQue\QueueWorker::iterate PHP Method

iterate() private method

private iterate ( string $queueName, integer $time = null )
$queueName string
$time integer
    private function iterate(string $queueName, int $time = null)
    {
        $received = $this->implementation->getQueueDriver()->awaitCommand($queueName, $time);
        $command = $this->implementation->getCommandSerializer()->unserialize($received->getSerialized());
        $this->implementation->getLogger()->debug('Command received', compact('command'));
        try {
            $this->implementation->getCommandBusAdapter()->handle($command, true);
            $this->implementation->getLogger()->info('Command handled', compact('command'));
        } catch (\Throwable $exception) {
            $this->implementation->getLogger()->error('Command failed', compact('command', 'exception'));
        } finally {
            $this->implementation->getQueueDriver()->completeCommand($received->getQueueName(), $received->getId());
        }
    }