Skip to content

Commit 3a7ad74

Browse files
committed
Documentation for removing stream listeners
1 parent 8997565 commit 3a7ad74

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,16 +358,25 @@ the same time is not guaranteed.
358358
The `removeReadStream(resource $stream): void` method can be used to
359359
remove the read event listener for the given stream.
360360

361+
Removing a stream from the loop that has already been removed or trying
362+
to remove a stream that was never added or is invalid has no effect.
363+
361364
### removeWriteStream()
362365

363366
The `removeWriteStream(resource $stream): void` method can be used to
364367
remove the write event listener for the given stream.
365368

369+
Removing a stream from the loop that has already been removed or trying
370+
to remove a stream that was never added or is invalid has no effect.
371+
366372
### removeStream()
367373

368374
The `removeStream(resource $stream): void` method can be used to
369375
remove all listeners for the given stream.
370376

377+
Removing a stream from the loop that has already been removed or trying
378+
to remove a stream that was never added or is invalid has no effect.
379+
371380
## Install
372381

373382
The recommended way to install this library is [through Composer](http://getcomposer.org).

src/LoopInterface.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,29 @@ public function addWriteStream($stream, callable $listener);
7777
/**
7878
* Remove the read event listener for the given stream.
7979
*
80+
* Removing a stream from the loop that has already been removed or trying
81+
* to remove a stream that was never added or is invalid has no effect.
82+
*
8083
* @param resource $stream The PHP stream resource.
8184
*/
8285
public function removeReadStream($stream);
8386

8487
/**
8588
* Remove the write event listener for the given stream.
8689
*
90+
* Removing a stream from the loop that has already been removed or trying
91+
* to remove a stream that was never added or is invalid has no effect.
92+
*
8793
* @param resource $stream The PHP stream resource.
8894
*/
8995
public function removeWriteStream($stream);
9096

9197
/**
9298
* Remove all listeners for the given stream.
9399
*
100+
* Removing a stream from the loop that has already been removed or trying
101+
* to remove a stream that was never added or is invalid has no effect.
102+
*
94103
* @param resource $stream The PHP stream resource.
95104
*/
96105
public function removeStream($stream);

0 commit comments

Comments
 (0)