Browse Source

doc: update writable.write return value

stream.md is updated to explain the return value of
writable.write(chunk) precisely.

PR-URL: https://github.com/nodejs/node/pull/9468
Fixes: https://github.com/nodejs/node/issues/9247
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ron Korving <ron@ronkorving.nl>
Reviewed-By: Roman Reiss <me@silverwind.io>
v6
Tanuja-Sawant 8 years ago
committed by Roman Reiss
parent
commit
f347dad0b7
No known key found for this signature in database GPG Key ID: 2E62B41C93869443
  1. 10
      doc/api/stream.md

10
doc/api/stream.md

@ -440,10 +440,12 @@ occurs, the `callback` *may or may not* be called with the error as its
first argument. To reliably detect write errors, add a listener for the
`'error'` event.
The return value indicates whether the written `chunk` was buffered internally
and the buffer has exceeded the `highWaterMark` configured when the stream was
created. If `false` is returned, further attempts to write data to the stream
should be paused until the [`'drain'`][] event is emitted.
The return value is `true` if the internal buffer does not exceed
`highWaterMark` configured when the stream was created after admitting `chunk`.
If `false` is returned, further attempts to write data to the stream should
stop until the [`'drain'`][] event is emitted. However, the `false` return
value is only advisory and the writable stream will unconditionally accept and
buffer `chunk` even if it has not not been allowed to drain.
A Writable stream in object mode will always ignore the `encoding` argument.

Loading…
Cancel
Save