On May 23, 2013, at 1:28 PM, Baz <[email protected]> wrote:
> Thanks Matt, so just to be crystal clear, if I'm using promises in my own 
> code, then I happen to have a flow that depends on fs, for example, and since 
> fs doesn't return or use promises, I would have to drop out of the promises 
> paradigm and manage that particular part of the flow control with callbacks 
> or something like asynch?
> 

Q provides you mechanisms to wrap non-promise returning calls (for both 
async/blocking/callback scenarios and — this is very useful — for functions 
that return immediately as well). If you are looking at these sort of 
libraries, I also heartily recommend Flow, which has the easiest learning curve 
IMHO: https://github.com/willconant/flow-js.

        —ravi


> 
> On Thu, May 23, 2013 at 7:01 AM, Matt <[email protected]> wrote:
> 
> On Thu, May 23, 2013 at 3:29 AM, Baz <[email protected]> wrote:
> I am new to Node and trying to decide between promises, asynch and vanilla, 
> there are so many good arguments for each. Mikeal, do you mind expanding 
> further how using promises in your own, non-shared, code could hinder use of 
> node? Do a lot of the libs that depend on asynch require you to use asynch as 
> well (or make things easier if you do)?
> 
> I think the problem with promises is that the core node libraries aren't 
> implemented with promises, so if you need to do a series of e.g. fs calls 
> (typical example might be open, then stat, then create a readStream from the 
> fd) you wind up using async anyway, or manually coding up the nested 
> callbacks, which can feel ugly once you've started using a particular flow 
> control library. And then once you start using async for one thing, it just 
> starts to feel natural. It just fits so perfectly with the Node ecosystem.
> 
> In short: There's nothing wrong with the promises model (although I find it 
> overly verbose), it's just that async fits better with node libraries.
> 
> Matt.
> 
> -- 
> -- 
> 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.
>  
>  
> 
> 
> -- 
> -- 
> 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.
>  
>  

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