jeffbski/event-stream — comment on commit c8bbd1a78a7c77bab7e974ff26d4af2fc506b449
File:  line 0
By jeffbski:

Dominic,

Wow, that is surprising! I didn't get that from reading the node man page,
I assumed they were implying that anything truthy (is success) and the
opposite would mean that it was not written completely and should be
expecting drain event.

Given that it is not real clear in the docs (what happens when returning
undefined or falsey values), anyone doing their own piping might simply
code it naively as

if (! stream.write('foo')) {
//expect drain
}

So IMO, I guess it would be safest to just return true or is there
something I am missing?

Thanks,

Jeff

On Tue, Nov 1, 2011 at 4:06 PM, Dominic Tarr <
reply@reply.github.com>wrote:

> this isn't actually correct. undefined does not mean 'pause'. `
> write (data) === false` means pause.
>
> https://github.com/joyent/node/blob/master/lib/stream.js#L38
>
> --
> Reply to this email directly or view it on GitHub:
>
> https://github.com/jeffbski/event-stream/commit/c8bbd1a78a7c77bab7e974ff26d4af2fc506b449#commitcomment-688767
>