highland
highland copied to clipboard
Make .end() behave like stream.end() ?
Hi,
Highland.js .end function doesn't accept parameters, and just closes the stream, unlike stream.end, which accepts 1 parameter of data, send it, and then closes the stream.
Does it make sense to change highland.js end function to be more like node end function ? I am building a lib, which provides it's users "smart" stream (e.g. highland streams), but end is not behaving the same.
Sure, we can do that. PR welcome. :)
However, I would be careful about treating highland streams as Node
Stream++, as they don't implement the full stream.Writable
interface. For
example, stream.end
contains an additional encoding
and callback
argument that we probably won't support.
Especially, don't encourage your users to use write
and end
directly.
Those are more to make Readable#pipe
work than anything else.
On Thu, Apr 9, 2015 at 1:56 AM, Asaf Yishai [email protected] wrote:
Hi,
Highland.js .end function doesn't accept parameters, and just closes the stream, unlike stream.end, which accepts 1 parameter of data, send it, and then causes an end.
Does it make sense to change highland.js end function to be more like node end function ? I am building a lib, which provides it's users "smart" stream (e.g. highland streams), but end is not behaving the same.
— Reply to this email directly or view it on GitHub https://github.com/caolan/highland/issues/265.