Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 808 Bytes

queue.md

File metadata and controls

22 lines (17 loc) · 808 Bytes

Command Queue

CommandBus immediately executes the command, but sometimes you need to delay the execution of the command and for this you can use the interface of the queue.

interface CommandQueue
{
    public function publish(Command $command): void;
}

The publishing interface is general, and the interface for obtaining commands from the queue depends on the implementation of the queue system.

We offer two options for implementing queues:

  • Pull - Pull queue is designed to explicitly pull commands from the queue. You can do this on a timer through cron;
  • Subscribe - Subscribe queue is designed for asynchronous work. The handler is called only when the message is published in the queue.