Esempio n. 1
0
 /**
  * Event break the base loop on limit
  *
  * @param EventInterface $event
  */
 public function basic_timed_event_03(EventInterface $event)
 {
     $this->counter++;
     echo sprintf("Loop breaking persistent event call %s. Timeout: %s.\n", $event->getName(), $event->getTimeout());
     if ($this->counter === $this->limit) {
         $event->getBase()->loopBreak();
         echo sprintf("Call limit exceed for event %s. Loop break.\n", $event->getName());
     }
 }
Esempio n. 2
0
 /**
  * @param EventInterface $event
  * @group helper
  */
 public function eventHandlerExitingLoop(EventInterface $event)
 {
     // Loop exit in 0.1sec
     $event->getBase()->loopExit(100000);
 }