doc: stream: clarify meaning of 'drain' some more

Courtesy of Lee Coltrane (@coltrane).
This commit is contained in:
Ben Noordhuis 2012-10-03 13:38:03 +02:00
parent f624be4093
commit b0d04ffbd8

View File

@ -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 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`. 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' ### Event: 'error'
`function (exception) { }` `function (exception) { }`