8000 Mark stream API as advanced and link to Stream component instead · reactphp/event-loop@753c911 · GitHub
[go: up one dir, main page]

Skip to content

Commit 753c911

Browse files
committed
Mark stream API as advanced and link to Stream component instead
1 parent 111ace2 commit 753c911

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ For the code of the current stable 0.4.x release, checkout the
2222
* [Install](#install)
2323
* [Tests](#tests)
2424
* [License](#license)
25+
* [More](#more)
2526

2627
## Quickstart example
2728

@@ -293,6 +294,11 @@ See also [example #3](examples).
293294

294295
### addReadStream()
295296

297+
> Advanced! Note that this low-level API is considered advanced usage.
298+
Most use cases should probably use the higher-level
299+
[readable Stream API](https://github.com/reactphp/stream#readablestreaminterface)
300+
instead.
301+
296302
The `addReadStream(resource $stream, callable $callback): void` method can be used to
297303
register a listener to be notified when a stream is ready to read.
298304

@@ -331,6 +337,11 @@ the same time is not guaranteed.
331337

332338
### addWriteStream()
333339

340+
> Advanced! Note that this low-level API is considered advanced usage.
341+
Most use cases should probably use the higher-level
342+
[writable Stream API](https://github.com/reactphp/stream#writablestreaminterface)
343+
instead.
344+
334345
The `addWriteStream(resource $stream, callable $callback): void` method can be used to
335346
register a listener to be notified when a stream is ready to write.
336347

@@ -420,3 +431,11 @@ $ php vendor/bin/phpunit
420431
## License
421432

422433
MIT, see [LICENSE file](LICENSE).
434+
435+
## More
436+
437+
* See our [Stream component](https://github.com/reactphp/stream) for more
438+
information on how streams are used in real-world applications.
439+
* See our [users wiki](https://github.com/reactphp/react/wiki/Users) and the
440+
[dependents on Packagist](https://packagist.org/packages/react/event-loop/dependents)
441+
for a list of packages that use the EventLoop in real-world applications.

src/LoopInterface.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
interface LoopInterface
88
{
99
/**
10-
* Register a listener to be notified when a stream is ready to read.
10+
* [Advanced] Register a listener to be notified when a stream is ready to read.
11+
*
12+
* Note that this low-level API is considered advanced usage.
13+
* Most use cases should probably use the higher-level
14+
* [readable Stream API](https://github.com/reactphp/stream#readablestreaminterface)
15+
* instead.
1116
*
1217
* The first parameter MUST be a valid stream resource that supports
1318
* checking whether it is ready to read by this loop implementation.
@@ -49,7 +54,12 @@ interface LoopInterface
4954
public function addReadStream($stream, callable $listener);
5055

5156
/**
52-
* Register a listener to be notified when a stream is ready to write.
57+
* [Advanced] Register a listener to be notified when a stream is ready to write.
58+
*
59+
* Note that this low-level API is considered advanced usage.
60+
* Most use cases should probably use the higher-level
61+
* [writable Stream API](https://github.com/reactphp/stream#writablestreaminterface)
62+
* instead.
5363
*
5464
* The first parameter MUST be a valid stream resource that supports
5565
* checking whether it is ready to write by this loop implementation.

0 commit comments

Comments
 (0)
0