Client/SpoolProducer.php
public function flush(): void
    {
        while (false == $this->events->isEmpty()) {
            list($topic, $message) = $this->events->dequeue();

            $this->realProducer->sendEvent($topic, $message);
        }

        while (false == $this->commands->isEmpty()) {
            list($command, $message) = $this->commands->dequeue();

            $this->realProducer->sendCommand($command, $message);
        }
    }
public function flush(): void
    {
        while (false == $this->events->isEmpty()) {
            list($topic, $message) = $this->events->dequeue();

            $this->realProducer->sendEvent($topic, $message);
        }

        while (false == $this->commands->isEmpty()) {
            list($command, $message) = $this->commands->dequeue();

            $this->realProducer->sendCommand($command, $message);
        }
    }
public function flush ( ) : void { while ( false == $ this -> events -> isEmpty ( ) ) { list ( $ topic , $ message ) = $ this -> events -> dequeue ( ) ; $ this -> realProducer -> sendEvent ( $ topic , $ message ) ; } while ( false == $ this -> commands -> isEmpty ( ) ) { list ( $ command , $ message ) = $ this -> commands -> dequeue ( ) ; $ this -> realProducer -> sendCommand ( $ command , $ message ) ; } }
When it is called it sends all previously queued messages.
When it is called it sends all previously queued messages .