MGDigital\BusQue\Redis\RedisDriver::receiveDueCommands PHP Метод

receiveDueCommands() публичный Метод

public receiveDueCommands ( DateTimeInterface $now, integer $limit = SchedulerWorker::DEFAULT_THROTTLE, DateTimeInterface $startTime = null ) : array
$now DateTimeInterface
$limit integer
$startTime DateTimeInterface
Результат array
    public function receiveDueCommands(\DateTimeInterface $now, int $limit = SchedulerWorker::DEFAULT_THROTTLE, \DateTimeInterface $startTime = null) : array
    {
        if ($startTime === null) {
            $start = 0;
        } else {
            $start = $startTime->getTimestamp();
        }
        $results = $this->evalScript('receive_due_messages', [$this->namespace, $start, $now->getTimestamp(), $limit]);
        $commands = [];
        foreach ($results as $result) {
            list($queueName, $id, $message, $score) = $result;
            $commands[] = new ReceivedScheduledCommand($queueName, $id, $message, new \DateTimeImmutable('@' . $score));
        }
        return $commands;
    }