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: