Skip to content

Commit 2eaa940

Browse files
ronagtargos
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 d9d6da4 commit 2eaa940

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

doc/api/stream.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,6 +1678,13 @@ of a stream that are intended for use by consumers (as described in the
16781678
[API for Stream Consumers][] section). Doing so may lead to adverse side effects
16791679
in application code consuming the stream.
16801680

1681+
Avoid overriding public methods such as `write()`, `end()`, `cork()`,
1682+
`uncork()`, `read()` and `destroy()`, or emitting internal events such
1683+
as `'error'`, `'data'`, `'end'`, `'finish'` and `'close'` through `.emit()`.
1684+
Doing so can break current and future stream invariants leading to behavior
1685+
and/or compatibility issues with other streams, stream utilities, and user
1686+
expectations.
1687+
16811688
### Simplified Construction
16821689
<!-- YAML
16831690
added: v1.2.0

0 commit comments

Comments
 (0)