protected function runEventQueue(
        EventInterface $event,
        EventQueueInterface $queue,
        callable $callback = null
    )/*# : EventManagerInterface */ {
        try {
            foreach ($queue as $data) {
                // execute each callable from the queue
                $res = call_user_func($data['data'], $event);

                // set results
                $event->setResult($res);

                // stop propagation if callable returns FALSE
                if ($res === false) {
                    $event->stopPropagation();
                }

                // break if event stopped
                if ($event->isPropagationStopped()) {
                    break;
                }

                // run callback
                if ($callback &&
                    call_user_func($callback, $event, $res) === false
                ) {
                    break;
                }
            }

            return $this;
        } catch (\Exception $e) {
            // rethrow any exception caught
            throw new Exception\RuntimeException(
                Message::get(Message::CALLABLE_RUNTIME, $e->getMessage()),
                $e->getCode(),
                $e
            );
        }
    }
protected function runEventQueue(
        EventInterface $event,
        EventQueueInterface $queue,
        callable $callback = null
    )/*# : EventManagerInterface */ {
        try {
            foreach ($queue as $data) {
                // execute each callable from the queue
                $res = call_user_func($data['data'], $event);

                // set results
                $event->setResult($res);

                // stop propagation if callable returns FALSE
                if ($res === false) {
                    $event->stopPropagation();
                }

                // break if event stopped
                if ($event->isPropagationStopped()) {
                    break;
                }

                // run callback
                if ($callback &&
                    call_user_func($callback, $event, $res) === false
                ) {
                    break;
                }
            }

            return $this;
        } catch (\Exception $e) {
            // rethrow any exception caught
            throw new Exception\RuntimeException(
                Message::get(Message::CALLABLE_RUNTIME, $e->getMessage()),
                $e->getCode(),
                $e
            );
        }
    }
protected function runEventQueue ( EventInterface $ event , EventQueueInterface $ queue , callable $ callback = null ) /*# : EventManagerInterface */ { try { foreach ( $ queue as $ data ) { // execute each callable from the queue $ res = call_user_func ( $ data [ 'data' ] , $ event ) ; // set results $ event -> setResult ( $ res ) ; // stop propagation if callable returns FALSE if ( $ res === false ) { $ event -> stopPropagation ( ) ; } // break if event stopped if ( $ event -> isPropagationStopped ( ) ) { break ; } // run callback if ( $ callback && call_user_func ( $ callback , $ event , $ res ) === false ) { break ; } } return $ this ; } catch ( \ Exception $ e ) { // rethrow any exception caught throw new Exception \ RuntimeException ( Message :: get ( Message :: CALLABLE_RUNTIME , $ e -> getMessage ( ) ) , $ e -> getCode ( ) , $ e ) ; } }
Run an event with the provided queue

The $callback defined as `function($event, $response) {}`, where
$reponse is the return value from previous event handler.

@param  EventInterface $event
@param  EventQueueInterface $queue
@param  callable $callback (optional) a callback returns bool
@return EventManagerInterface this
@throws \Phossa\Event\Exception\RuntimeException
rethrow any exception catched as RuntimeException
@access protected
Run an event with the provided queue