From 4da85097d5b045139faf837c0874021a49660004 Mon Sep 17 00:00:00 2001 From: Andrew Carter Date: Wed, 17 Feb 2016 15:25:39 +0000 Subject: [PATCH] Update EventLoopInterface.php --- src/EventLoopInterface.php | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/src/EventLoopInterface.php b/src/EventLoopInterface.php index c6905d2..ab5768d 100644 --- a/src/EventLoopInterface.php +++ b/src/EventLoopInterface.php @@ -4,4 +4,53 @@ namespace Interop\Async\EventLoop; interface EventLoopInterface { + /** + * @return void + */ + public function run(callable $onStart = null); + + /** + * @return void + */ + public function tick(bool $block = true); + + /** + * @return void + */ + public function stop(); + + /** + * @return Watcher + */ + public function queue(callable $callback, ...$args); + + /** + * @return Watcher + */ + public function timer(callable $callback, float $time, $data = null); + + /** + * @return Watcher + */ + public function periodic(callable $callback, float $interval, $data = null); + + /** + * @return Watcher + */ + public function onReadable($stream, callable $callback, $data = null); + + /** + * @return Watcher + */ + public function onWritable($stream, callable $callback, $data = null); + + /** + * @return Watcher + */ + public function onSignal(int $signo, callable $callback, $data = null); + + /** + * @return Watcher + */ + public function onError(callable $callback); }