예제 #1
0
파일: Loop.php 프로젝트: expressif/stream
     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
  */
 public static function start()
예제 #2
0
<?php

function autoLoad($method)
{
    $method = str_replace('\\', '/', strtolower($method));
    chdir(__DIR__);
    require $method . '.php';
}
spl_autoload_register('autoLoad');
$plane = new Plane(0, 0, 1000, 100);
Loop::start($plane);