/** * {@inheritDoc} */ public function processEvent(EventInterface $event, callable $callback = null) { // check self's queue $queue = $this->matchEventQueue($event->getName(), $this); // run thru the queue return $this->runEventQueue($event, $queue, $callback); }
/** * Process events by all managers in the pool * * {@inheritDoc} */ public function processEvent(Interfaces\EventInterface $event, callable $callback = null) { $eventName = $event->getName(); // check self's queue $queue = $this->matchEventQueue($eventName, $this); // merge with other managers' queue $managers = $this->getOtherManagers(); foreach ($managers as $mgr) { // other manager's own queue $q = $this->matchEventQueue($eventName, $mgr); if ($q->count()) { $queue = $queue->combine($q); } } // run thru the queue return $this->runEventQueue($event, $queue, $callback); }