public static function setInterval($fn, $interval) { $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; } /**