Can you expound on this, particularly why it's an "abuse"?  I've been using 
this technique in an ad hoc manner with apparent success, and find it much 
less convoluted (and, at least at first glance, more "node-ish") than the 
other async/promise/... libraries which get promoted here from time to 
time.  I find it particularly useful during server startup, when I have a 
bunch of tasks (reading config, fetching many documents from a variety of 
remote databases, warming caches, etc.) that have a mix of serial/parallel 
relationships.  I've actually thought for some time that it would be handy 
if EventEmitter had native support for at least the parallel case (i.e. a 
flavor of listener that fires after all of a list events have occurred, or 
a certain number of one event).  --Ken

On Tuesday, January 15, 2013 10:54:31 PM UTC-8, Raynos wrote:
>
> You guys realize that using events to effectively call a series of 
> functions in parallel or series is abuse of the event emitter right.
>
> What your doing there is RPC over events. RPC is best done with something 
> like functions or methods
>
> If an event handler can error you need to put down your EventEmitter and 
> think about your code and how to structure it.
>
>
> On Tue, Jan 15, 2013 at 2:48 PM, Brian Link <[email protected]<javascript:>
> > wrote:
>
>> Very cool.  I've been loving this pattern. Bright minds ...
>>
>>
>> On Tuesday, January 15, 2013 2:35:31 PM UTC-8, Katsumoto wrote:
>>>
>>> I'm using the same flow for almost a year in my framework. 
>>> Here is my lightweight implementation: https://github.com/Shogun147/**
>>> Katana/blob/master/lib/**bootstrap.js#L1-L40<https://github.com/Shogun147/Katana/blob/master/lib/bootstrap.js#L1-L40>
>>>
>>  -- 
>> 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
>>
>
>

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

Reply via email to