Skip to content

Strict definition for event callback functions #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ read-only streams and the readable side of duplex streams.
Besides defining a few methods, this interface also implements the
`EventEmitterInterface` which allows you to react to certain events.

The event callback functions MUST be a valid `callable` that obeys strict
parameter definitions and MUST accept event parameters exactly as documented.
The event callback functions MUST NOT throw an `Exception`.
The return value of the event callback functions will be ignored and has no
effect, so for performance reasons you're recommended to not return any
excessive data structures.

Every implementation of this interface MUST follow these event semantics in
order to be considered a well-behaving stream.

Expand Down Expand Up @@ -392,6 +399,13 @@ write-only streams and the writable side of duplex streams.
Besides defining a few methods, this interface also implements the
`EventEmitterInterface` which allows you to react to certain events.

The event callback functions MUST be a valid `callable` that obeys strict
parameter definitions and MUST accept event parameters exactly as documented.
The event callback functions MUST NOT throw an `Exception`.
The return value of the event callback functions will be ignored and has no
effect, so for performance reasons you're recommended to not return any
excessive data structures.

Every implementation of this interface MUST follow these event semantics in
order to be considered a well-behaving stream.

Expand Down Expand Up @@ -721,6 +735,13 @@ Besides defining a few methods, this interface also implements the
`EventEmitterInterface` which allows you to react to the same events defined
on the `ReadbleStreamInterface` and `WritableStreamInterface`.

The event callback functions MUST be a valid `callable` that obeys strict
parameter definitions and MUST accept event parameters exactly as documented.
The event callback functions MUST NOT throw an `Exception`.
The return value of the event callback functions will be ignored and has no
effect, so for performance reasons you're recommended to not return any
excessive data structures.

Every implementation of this interface MUST follow these event semantics in
order to be considered a well-behaving stream.

Expand Down
7 changes: 7 additions & 0 deletions src/DuplexStreamInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
* `EventEmitterInterface` which allows you to react to the same events defined
* on the `ReadbleStreamInterface` and `WritableStreamInterface`.
*
* The event callback functions MUST be a valid `callable` that obeys strict
* parameter definitions and MUST accept event parameters exactly as documented.
* The event callback functions MUST NOT throw an `Exception`.
* The return value of the event callback functions will be ignored and has no
* effect, so for performance reasons you're recommended to not return any
* excessive data structures.
*
* Every implementation of this interface MUST follow these event semantics in
* order to be considered a well-behaving stream.
*
Expand Down
7 changes: 7 additions & 0 deletions src/ReadableStreamInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@
* non-writable AND non-readable mode, see also `isWritable()`.
* Note that this event should not be confused with the `end` event.
*
* The event callback functions MUST be a valid `callable` that obeys strict
* parameter definitions and MUST accept event parameters exactly as documented.
* The event callback functions MUST NOT throw an `Exception`.
* The return value of the event callback functions will be ignored and has no
* effect, so for performance reasons you're recommended to not return any
* excessive data structures.
*
* Every implementation of this interface MUST follow these event semantics in
* order to be considered a well-behaving stream.
*
Expand Down
7 changes: 7 additions & 0 deletions src/WritableStreamInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@
* non-writable AND non-readable mode, see also `isReadable()`.
* Note that this event should not be confused with the `end` event.
*
* The event callback functions MUST be a valid `callable` that obeys strict
* parameter definitions and MUST accept event parameters exactly as documented.
* The event callback functions MUST NOT throw an `Exception`.
* The return value of the event callback functions will be ignored and has no
* effect, so for performance reasons you're recommended to not return any
* excessive data structures.
*
* Every implementation of this interface MUST follow these event semantics in
* order to be considered a well-behaving stream.
*
Expand Down