Skip to content
Permalink
Browse files

doc: add note of caution about non-conforming streams

PR-URL: #29895
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
ronag authored and MylesBorins committed Oct 9, 2019
1 parent df91d5f commit 0d6fbe8b30eb83aee829b582fad8ca2993e1e18d
Showing with 7 additions and 0 deletions.
  1. +7 −0 doc/api/stream.md
@@ -1678,6 +1678,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.

Avoid overriding public methods such as `write()`, `end()`, `cork()`,
`uncork()`, `read()` and `destroy()`, or emitting internal events such
as `'error'`, `'data'`, `'end'`, `'finish'` and `'close'` through `.emit()`.
Doing so can break current and future stream invariants leading to behavior
and/or compatibility issues with other streams, stream utilities, and user
expectations.

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

0 comments on commit 0d6fbe8

Please sign in to comment.
You can’t perform that action at this time.