[responding on list]

We're talking about flushing left-over data in a scenario where data is
written in blocks, for example. The last write callback hasn't fired when
end() is called; or write callbacks might simply fire on nextTick unless we
paused writing out blocks.

Flushing on 'finish' works only if there's no one else listening on
'finish'. And then our stream subclass doesn't conform to the Writable API.


On Wed, Apr 17, 2013 at 11:40 AM, Isaac Schlueter <i...@izs.me> wrote:

> Well, you shouldn't be calling the write callback until that chunk is
> "flushed" anyway, right? Seems like listening to your own finish event is
> probably fine. Maybe I'm missing something still?
>
> On Wednesday, April 17, 2013, Liam Breck wrote:
>
>> Only if the 'finish' event could be suppressed by _flush() for other
>> listeners, which I don't see a way to do...
>>
>> Alternatively the subclass can violate the defined API, and emit
>> 'really_finished' from _flush()
>>
>>
>> On Wed, Apr 17, 2013 at 1:12 AM, Floby <florent.j...@gmail.com> wrote:
>>
>>> It is not essential in the sense that you can already do something
>>> similar by listening to the 'finish' event. However observing oneself is a
>>> strange pattern. but one implentation of _flush could easily be:
>>>
>>> this.on('finish', this._flush);
>>>
>>> is that correct ?
>>>
>>

-- 
-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
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 nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to