ScheduledStamp example

class SchedulerTransport implements TransportInterface
{
    public function __construct(
        private readonly MessageGeneratorInterface $messageGenerator,
    ) {
    }

    public function get(): iterable
    {
        foreach ($this->messageGenerator->getMessages() as $context => $message) {
            $stamp = new ScheduledStamp($context);

            if ($message instanceof RedispatchMessage) {
                $message = new RedispatchMessage(
                    Envelope::wrap($message->envelope, [$stamp]),
                    $message->transportNames,
                );
            }

            yield Envelope::wrap($message[$stamp]);
        }
    }

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