From b0d04ffbd877309b9ce56fe19957d78b47ad9cf4 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 3 Oct 2012 13:38:03 +0200 Subject: [PATCH] doc: stream: clarify meaning of 'drain' some more Courtesy of Lee Coltrane (@coltrane). --- doc/api/stream.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/stream.markdown b/doc/api/stream.markdown index e02765af2..5e0c6f642 100644 --- a/doc/api/stream.markdown +++ b/doc/api/stream.markdown @@ -123,6 +123,10 @@ A `Writable Stream` has the following methods, members, and events. Emitted when the stream's write queue empties and it's safe to write without buffering again. Listen for it when `stream.write()` returns `false`. +The `'drain'` event can happen at *any* time, regardless of whether or not +`stream.write()` has previously returned `false`. To avoid receiving unwanted +`'drain'` events, listen using `stream.once()`. + ### Event: 'error' `function (exception) { }` -- 2.34.1