Skip to content
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

doc: add notes about non-conforming streams #29895

Closed
wants to merge 8 commits into from
Closed
Changes from 4 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
7 changes: 7 additions & 0 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -1667,6 +1667,13 @@ of a stream that are intended for use by consumers (as described in the
[API for Stream Consumers][] section). Doing so may lead to adverse side effects
in application code consuming the stream.

It is highly discouraged to override any public method or to emit any internal
ronag marked this conversation as resolved.
Show resolved Hide resolved
events such as `'error'`, `'data'`, `'end'`, `'finish'` and `'close'` manually
through `.emit(eventName)` instead of using API provided callbacks or
`.destroy(err)`. Doing so can break current and future stream invariants
lundibundi marked this conversation as resolved.
Show resolved Hide resolved
leading to behavior and/or compatibility issues with other streams, stream
utilities and user expectations.

### Simplified Construction
<!-- YAML
added: v1.2.0
Expand Down