Usually "clean up" means "close" rather than "finish".  The "finish"
event simply means that all the data has been written, not necessarily
that any underlying resources have been cleaned up.

You could listen on "finish" and do it then.

If it's a Transform stream, and you need to make sure that you flush
something to the output after the last chunk is processed, you can
implement a `_flush(callback)` method.


On Mon, Apr 15, 2013 at 2:28 PM, Liam <[email protected]> wrote:
> We need to make an async call to clean up our writable stream
> implementation, before emitting finish.
>
>
> On Monday, April 15, 2013 11:50:05 AM UTC-7, Isaac Schlueter wrote:
>>
>> You do not need to implement end(), no.  In fact, you probably shouldn't.
>>
>> What are you trying to do?
>>
>> Note that Writables don't get an 'end' event, but rather a 'finish' event.
>>
>> On Mon, Apr 15, 2013 at 9:55 AM, Liam <[email protected]> wrote:
>> > I had the impression that _write() was the only method required in a
>> > stream.Writable subclass; is an end() implementation required to detect
>> > calls to end()?
>> >
>> > This code shows that implementing _write() in a stream.Writable
>> > implementation won't detect a call to end()
>> >
>> > https://gist.github.com/mtibeica/5389437
>> >

-- 
-- 
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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to