示例#1
0
文件: Loop.php 项目: expressif/stream
     $e = new Timer($fn, $interval);
     self::$items->attach($e);
     return $e;
 }
 /**
  * Clear the specified interval
  */
 public static function clearInterval(Timer $timer)
 {
     self::$items->detach($timer);
     $timer->__destruct();
 }
 /**
  * Attach the specified callback on the specified descriptor
  * @return Event
  */
 public static function stop()
 {
     self::$run = false;
     event_base_loopexit(self::$base, 1000);
 }
 /**
  * Check if the loop is started
  */
 public static function isStarted()
 {
     return self::$run;
 }
 /**
  * Starts the event loop
  */