public function flush()
    {
        $this->queue->setIteratorMode(\SplQueue::IT_MODE_DELETE);

        foreach ($this->queue as $event)
        {
            $class = get_class($event);

            foreach ($this->asynchronousEventMap->getListenersForEvent($class) as $listener)
            {
                $this->invokeListener($listener, $event);
            }
        }
    }