I advocated early for the simpler read with callback:

https://groups.google.com/forum/#!topic/nodejs-dev/djqqFhrObB8 (July 2012)
http://bjouhier.wordpress.com/2012/07/04/node-js-stream-api-events-or-callbacks/

I tried to get the ball running a few more times:

https://groups.google.com/forum/#!topic/nodejs/d_8EL8fMRW4[1-25-false] (Oct 
2012)
https://github.com/joyent/node/commit/88644eaa2db3e9b603efca00e640ff08d9320c1b#commitcomment-2730671
 
(Mar 2013)

Now it is too late :-(

Less API is better API.

Bruno

On Monday, March 18, 2013 8:08:24 PM UTC+1, Nathan Rajlich wrote:
>
> I also find that implementing a custom Writable stream (one callback) is 
> easier than the .read() function that we have now (event, synchronous 
> function with inconsistent return value). I've brought up my concerns about 
> .read() before[0] but unfortunately it was too late and now we're stuck 
> with what we got.
>
> So in short, *no*, I don't think there's any benefit for using the .read() 
> function directly rather than implementing a separate Writable class. As 
> far as I'm concerned the only API for consuming readables is .pipe().
>
> 0: https://github.com/joyent/node/pull/4835#issuecomment-14024535 
>
> On Mon, Mar 18, 2013 at 11:06 AM, Sigurgeir Jonsson 
> <[email protected]<javascript:>
> > wrote:
>
>> The new streams have excellent support for high/low watermarks and 
>> auto-pausing/resuming, but the documentation confuses me a little... 
>> particularly the read method.
>>
>> When I read the new docs for the first time I was under the impression 
>> that the optimal way to become a user of a stream is to write loops around 
>> the read functio.  However in practice I find myself simply writing custom 
>> writeStreams and use the callback to control upstream pressure (in addition 
>> to source Watermarks if needed).   Here is an example where I move the 
>> output to a queue that executes a custom function in parallel (i.e. 
>> uploading to a database)    https://gist.github.com/ZJONSSON/5189249
>>
>> Are there any benefits to using the read method directly on a stream vs. 
>> piping to a custom Writable stream?  
>>
>> -- 
>> -- 
>> 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]<javascript:>
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>
>> 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] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
-- 
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