Ejemplo n.º 1
0
 /**
  * @param LoopEvent $event
  */
 public function sleep(LoopEvent $event)
 {
     $interval = $event->getConfig()->getInterval();
     if (null !== $interval) {
         usleep($interval);
     }
 }
Ejemplo n.º 2
0
 /**
  * @param LoopEvent $event
  */
 public function checkExecutions(LoopEvent $event)
 {
     $repeat = $event->getConfig()->getRepeat();
     $this->executions += 1;
     if (null !== $repeat && $repeat <= $this->executions) {
         throw new LoopException('maximum loop executions reached', 0, $event->getException());
     }
 }