Skip to content

Commit 00f7cc6

Browse files
ronagaddaleax
authored andcommitted
doc: add note of caution about non-conforming streams
PR-URL: #29895 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Yorkie Liu <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 84f7b5c commit 00f7cc6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/api/stream.md

+7
Original file line numberDiff line numberDiff line change
@@ -1692,6 +1692,13 @@ of a stream that are intended for use by consumers (as described in the
16921692
[API for Stream Consumers][] section). Doing so may lead to adverse side effects
16931693
in application code consuming the stream.
16941694

1695+
Avoid overriding public methods such as `write()`, `end()`, `cork()`,
1696+
`uncork()`, `read()` and `destroy()`, or emitting internal events such
1697+
as `'error'`, `'data'`, `'end'`, `'finish'` and `'close'` through `.emit()`.
1698+
Doing so can break current and future stream invariants leading to behavior
1699+
and/or compatibility issues with other streams, stream utilities, and user
1700+
expectations.
1701+
16951702
### Simplified Construction
16961703
<!-- YAML
16971704
added: v1.2.0

0 commit comments

Comments
 (0)