protected function dispatchPendingEvents(ConnectionInterface $connection)
    {
        $connectionId = $connection->getName();
        $consumingEvents = $this->pendingEvents[$connectionId];

        unset($this->pendingEvents[$connectionId]);

        foreach ($consumingEvents as $transactionsEvents) {
            foreach ($transactionsEvents as $transactionEvents) {
                foreach ($transactionEvents as $event) {
                    $this->dispatcher->dispatch($event['event'], $event['payload']);
                }
            }
        }
    }
protected function dispatchPendingEvents(ConnectionInterface $connection)
    {
        $connectionId = $connection->getName();
        $consumingEvents = $this->pendingEvents[$connectionId];

        unset($this->pendingEvents[$connectionId]);

        foreach ($consumingEvents as $transactionsEvents) {
            foreach ($transactionsEvents as $transactionEvents) {
                foreach ($transactionEvents as $event) {
                    $this->dispatcher->dispatch($event['event'], $event['payload']);
                }
            }
        }
    }
protected function dispatchPendingEvents ( ConnectionInterface $ connection ) { $ connectionId = $ connection -> getName ( ) ; $ consumingEvents = $ this -> pendingEvents [ $ connectionId ] ; unset ( $ this -> pendingEvents [ $ connectionId ] ) ; foreach ( $ consumingEvents as $ transactionsEvents ) { foreach ( $ transactionsEvents as $ transactionEvents ) { foreach ( $ transactionEvents as $ event ) { $ this -> dispatcher -> dispatch ( $ event [ 'event' ] , $ event [ 'payload' ] ) ; } } } }
Flush all pending events for the given connection.

@param  \Illuminate\Database\ConnectionInterface  $connection
@return void
Flush all pending events for the given connection .