| 1 |
<?php |
| 2 |
|
| 3 |
namespace React\Stream; |
| 4 |
|
| 5 |
/** |
| 6 |
* The `DuplexStreamInterface` is responsible for providing an interface for |
| 7 |
* duplex streams (both readable and writable). |
| 8 |
* |
| 9 |
* It builds on top of the existing interfaces for readable and writable streams |
| 10 |
* and follows the exact same method and event semantics. |
| 11 |
* If you're new to this concept, you should look into the |
| 12 |
* `ReadableStreamInterface` and `WritableStreamInterface` first. |
| 13 |
* |
| 14 |
* Besides defining a few methods, this interface also implements the |
| 15 |
* `EventEmitterInterface` which allows you to react to the same events defined |
| 16 |
* on the `ReadbleStreamInterface` and `WritableStreamInterface`. |
| 17 |
* |
| 18 |
* The event callback functions MUST be a valid `callable` that obeys strict |
| 19 |
* parameter definitions and MUST accept event parameters exactly as documented. |
| 20 |
* The event callback functions MUST NOT throw an `Exception`. |
| 21 |
* The return value of the event callback functions will be ignored and has no |
| 22 |
* effect, so for performance reasons you're recommended to not return any |
| 23 |
* excessive data structures. |
| 24 |
* |
| 25 |
* Every implementation of this interface MUST follow these event semantics in |
| 26 |
* order to be considered a well-behaving stream. |
| 27 |
* |
| 28 |
* > Note that higher-level implementations of this interface may choose to |
| 29 |
* define additional events with dedicated semantics not defined as part of |
| 30 |
* this low-level stream specification. Conformance with these event semantics |
| 31 |
* is out of scope for this interface, so you may also have to refer to the |
| 32 |
* documentation of such a higher-level implementation. |
| 33 |
* |
| 34 |
* @see ReadableStreamInterface |
| 35 |
* @see WritableStreamInterface |
| 36 |
*/ |
| 37 |
interface DuplexStreamInterface extends ReadableStreamInterface, WritableStreamInterface |
| 38 |
{ |
| 39 |
} |