From 899e10034959e2957d94ca13130a08298ccef7da Mon Sep 17 00:00:00 2001 From: Andrew Carter Date: Wed, 23 Mar 2016 09:47:18 +0000 Subject: [PATCH] Added reference() and unreference() --- src/EventLoopInterface.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/EventLoopInterface.php b/src/EventLoopInterface.php index 409ebdd..914bd5e 100644 --- a/src/EventLoopInterface.php +++ b/src/EventLoopInterface.php @@ -112,4 +112,27 @@ interface EventLoopDriver * @return void */ public function cancel(string $eventIdentifier); + + /** + * Reference an event. + * + * This will keep the event loop alive whilst the event is still being monitored. Events have this state by default. + * + * @param string $eventIdentifier The event identifier. + * + * @return void + */ + public function reference(string $eventIdentifier); + + /** + * Unreference an event. + * + * The event loop should exit the run method when only unreferenced events are still being monitored. Events are all + * referenced by default. + * + * @param string $eventIdentifier The event identifier. + * + * @return void + */ + public function unreference(string $eventIdentifier); }