Hi,
I am wondering whats the best way of reading some data from a file stream
(readable stream) and under a certain condition stop reading? Is it safe to
e.g. call destroy() from within the on('data') handler? Or do I even have
to cleanup the stream at all?
Take this example in pseudo code:
v
On Thu, Jul 11, 2013 at 5:52 PM, Benjamin Pasero
wrote:
> Hi,
>
> I am wondering whats the best way of reading some data from a file stream
> (readable stream) and under a certain condition stop reading? Is it safe to
> e.g. call destroy() from within the on('data') handler? Or do I even have to
>
So you say, destroying a stream like that should not trigger any error?
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To p
On Sat, Jul 13, 2013 at 10:37 AM, Benjamin Pasero
wrote:
> So you say, destroying a stream like that should not trigger any error?
No.
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message bec
so I read into the source code of readable stream in fs and I can see that
destroy() calls close() in the end but it does not support any callback. it
seems to me that calling close() on the stream and passing in a callback is
much safer because I can continue when the stream is really closed. s