-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Description
The return value indicates whether the written
chunkwas buffered internally and the buffer has exceeded thehighWaterMarkconfigured when the stream was created. Iffalseis returned, further attempts to write data to the stream should be paused until the'drain'event is emitted.
This suggests that when writable.write(chunk) returns false, the passed chunk was not buffered. In reality, write() always unconditionally buffers the chunk regardless of what it returns. Its return value is only advisory.
I would suggest language like this
The return value is
trueif the internal buffer does not exceedhighWaterMarkconfigured when the stream was created after admittingchunk. Iffalseis returned, further attempts to write data to the stream should be paused until the'drain'event is emitted. However, thefalsereturn value is only advisory and the writable stream will unconditionally acceptchunkeven if it has not not been allowed to drain.