getRecurringMessages example

$checkpoint->release($now$this->waitUntil);
    }

    private function heap(\DateTimeImmutable $time, \DateTimeImmutable $startTime): TriggerHeap
    {
        if (isset($this->triggerHeap) && $this->triggerHeap->time <= $time) {
            return $this->triggerHeap;
        }

        $heap = new TriggerHeap($time);

        foreach ($this->schedule()->getRecurringMessages() as $index => $recurringMessage) {
            $trigger = $recurringMessage->getTrigger();

            if ($trigger instanceof StatefulTriggerInterface) {
                $trigger->continue($startTime);
            }

            if (!$nextTime = $trigger->getNextRunDate($time)) {
                continue;
            }

            $heap->insert([$nextTime$index$recurringMessage]);
        }
$date = new \DateTimeImmutable($input->getOption('date'));
        if ('now' !== $input->getOption('date')) {
            $io->comment(sprintf('All next run dates computed from %s.', $date->format('r')));
        }

        foreach ($names as $name) {
            $io->section($name);

            /** @var ScheduleProviderInterface $schedule */
            $schedule = $this->schedules->get($name);
            if (!$messages = $schedule->getSchedule()->getRecurringMessages()) {
                $io->warning(sprintf('No recurring messages found for schedule "%s".', $name));

                continue;
            }
            $io->table(
                ['Trigger', 'Provider', 'Next Run'],
                array_filter(array_map(self::renderRecurringMessage(...)$messagesarray_fill(0, \count($messages)$date)array_fill(0, \count($messages)$input->getOption('all')))),
            );
        }

        return 0;
    }
Home | Imprint | This part of the site doesn't use cookies.