@@ -9,6 +9,13 @@ interface LoopInterface
99 /**
1010 * Register a listener to be notified when a stream is ready to read.
1111 *
12+ * The first parameter MUST be a valid stream resource that supports
13+ * checking whether it is ready to read by this loop implementation.
14+ * A single stream resource MUST NOT be added more than once.
15+ * Instead, either call [`removeReadStream()`](#removereadstream) first or
16+ * react to this event with a single listener and then dispatch from this
17+ * listener.
18+ *
1219 * The listener callback function MUST be able to accept a single parameter,
1320 * the stream resource added by this method or you MAY use a function which
1421 * has no parameters at all.
@@ -37,12 +44,20 @@ interface LoopInterface
3744 *
3845 * @param resource $stream The PHP stream resource to check.
3946 * @param callable $listener Invoked when the stream is ready.
47+ * @see self::removeReadStream()
4048 */
4149 public function addReadStream ($ stream , callable $ listener );
4250
4351 /**
4452 * Register a listener to be notified when a stream is ready to write.
4553 *
54+ * The first parameter MUST be a valid stream resource that supports
55+ * checking whether it is ready to write by this loop implementation.
56+ * A single stream resource MUST NOT be added more than once.
57+ * Instead, either call [`removeWriteStream()`](#removewritestream) first or
58+ * react to this event with a single listener and then dispatch from this
59+ * listener.
60+ *
4661 * The listener callback function MUST be able to accept a single parameter,
4762 * the stream resource added by this method or you MAY use a function which
4863 * has no parameters at all.
@@ -71,6 +86,7 @@ public function addReadStream($stream, callable $listener);
7186 *
7287 * @param resource $stream The PHP stream resource to check.
7388 * @param callable $listener Invoked when the stream is ready.
89+ * @see self::removeWriteStream()
7490 */
7591 public function addWriteStream ($ stream , callable $ listener );
7692
0 commit comments