/**
  * Notifies all listeners of event name, unit the callable returns $state,
  * or the $event is set to handled.
  *
  * @param IEvent $event
  * @param mixed $state
  * @return IEvent
  */
 public function notifyUntil(IEvent $event, $state = true)
 {
     foreach ($this->getListeners($event->getName()) as $callable) {
         $result = $this->emitEvent($event, $callable);
         if ($result === $state || $event->isHandled()) {
             $event->setHandled(true);
             break;
         }
     }
     return $event;
 }
 protected function _defaultBehaviour(IEvent $e)
 {
     $msg = '[' . get_class($e->getSource()) . '->' . $e->getName() . '] ' . trim((string) $e->getContext());
     $this->_log->write($msg);
     echo $msg . System::crlf;
 }