Skip to content

Commit 899e100

Browse files
Added reference() and unreference()
1 parent 2b2b467 commit 899e100

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/EventLoopInterface.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,4 +112,27 @@ public function disable(string $eventIdentifier);
112112
* @return void
113113
*/
114114
public function cancel(string $eventIdentifier);
115+
116+
/**
117+
* Reference an event.
118+
*
119+
* This will keep the event loop alive whilst the event is still being monitored. Events have this state by default.
120+
*
121+
* @param string $eventIdentifier The event identifier.
122+
*
123+
* @return void
124+
*/
125+
public function reference(string $eventIdentifier);
126+
127+
/**
128+
* Unreference an event.
129+
*
130+
* The event loop should exit the run method when only unreferenced events are still being monitored. Events are all
131+
* referenced by default.
132+
*
133+
* @param string $eventIdentifier The event identifier.
134+
*
135+
* @return void
136+
*/
137+
public function unreference(string $eventIdentifier);
115138
}

0 commit comments

Comments
 (0)