TriggerHeap example

$this->waitUntil = $heap->isEmpty() ? null : $heap->top()[0];

        $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;
            }

            
Home | Imprint | This part of the site doesn't use cookies.