From 97fbceaaedfa3e18d9b70e8ff9364748697a1ee6 Mon Sep 17 00:00:00 2001 From: Tanuja-Sawant Date: Fri, 4 Nov 2016 21:11:10 +0530 Subject: [PATCH 1/3] doc: update stream.md stream.md is updated to explain the return value of writable.write(chunk) precisely. Fixes: https://github.com/nodejs/node/issues/9247 --- doc/api/stream.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 6b12ea8ee0a981..2a4d6cc669ba7d 100644 --- a/doc/api/stream.md +++ b/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 be paused until the [`'drain'`][] event is emitted. However, the +`false` return value is only advisory and the writable stream will +unconditionally accept `chunk` even if it has not not been allowed to drain. A Writable stream in object mode will always ignore the `encoding` argument. From 39c77bb4b87ea514278e8079fd550f362bfe573a Mon Sep 17 00:00:00 2001 From: Tanuja-Sawant Date: Sat, 5 Nov 2016 00:51:50 +0530 Subject: [PATCH 2/3] doc: update stream.md stream.md is updated to explain the return value of writable.write(chunk) precisely. Fixes: https://github.com/nodejs/node/issues/9247 --- doc/api/stream.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 2a4d6cc669ba7d..ccde34e7e0daa4 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -442,8 +442,8 @@ first argument. To reliably detect write errors, add a listener for the 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 be paused until the [`'drain'`][] event is emitted. However, the +`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 `chunk` even if it has not not been allowed to drain. From dba0251ef06de5e774862daaed3d14f0a4aac676 Mon Sep 17 00:00:00 2001 From: Tanuja-Sawant Date: Tue, 8 Nov 2016 10:51:02 +0530 Subject: [PATCH 3/3] doc: update stream.md stream.md is updated to explain the return value of writable.write(chunk) precisely. Fixes: https://github.com/nodejs/node/issues/9247 --- doc/api/stream.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index ccde34e7e0daa4..205b68a5375bcf 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -445,7 +445,7 @@ The return value is `true` if the internal buffer does not exceed `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 `chunk` even if it has not not been allowed to drain. +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.