I don't quite get the academic disagreement.  Its an EventEmitter, 
literally .. you can on/emit like usual.  If you like, you can register 
async handlers (fine, not 'events').  You could identify those handlers 
with a prefix if you are concerned about mixups (e.g. 
`emitter.on('hook:validate')`).

I'll concede that this debate has sparked some ideas of better separating 
the 'handlers' from the regular 'events'.  It might be more generically 
useful (and safer from programmer errors) if it served as more of a mix-in 
that you would add on to an EventEmitter (or any other object) and the api 
was name-spaced.  Something like:

```
var emitter = new require('events').EventEmitter();
require('eventflow')(emitter);

// Adds (don't like 'flow', but works for illustration)
emitter.flow.handle('validate', function (model, [cb]) { ... });
emitter.flow.series();
emitter.flow.parallel();
// etc.
```

I'd probably still use an EventEmitter internally to take advantage of 
on(), setMaxListeners(), removeAllListeners(), etc.

On Thursday, January 17, 2013 10:06:58 PM UTC-5, Raynos wrote:
>
> If you emit a callback on an event then its bidirectional and not an event.
>
> By all means make a new thing but don't call it an eventemitter.
>
>
> On Wed, Jan 16, 2013 at 10:48 PM, Brian Link <[email protected]<javascript:>
> > wrote:
>
>> > The most important thing is that event emitters is a single direction 
>> communication. If you want bidirectional communication use a duplex stream 
>> or functions
>>
>> This is all that is happening here.  We have an array of functions that 
>> get called either in parallel or series.  Its convenient that the 
>> EventEmitter object already has support for storing arrays of functions 
>> associated with a string key.  So.. I'm using it :)
>>
>>
>> On Monday, January 14, 2013 7:21:58 PM UTC-5, Brian Link wrote:
>>>
>>> Over the past few months I've been using this little utility module in 
>>> my applications.  Thought I would share it here now that it is stable and 
>>> well-documented.
>>>
>>> https://github.com/cpsubrian/**node-eventflow<https://github.com/cpsubrian/node-eventflow>
>>>
>>> EventFlow exposes some of the great flow-control utility provided by 
>>> caolan's async module in the form of events.  Basically, you'll be able to 
>>> 'register' asynchronous (or sync, or a mix) handlers via the `emitter.on()` 
>>> syntax you are already familiar with.  Then you can fire them with 
>>> `emitter.series()`, `emitter.parallel()`, `emitter.waterfall()`, etc.
>>>
>>> The docs should explain it all but I'm happy to answer any questions 
>>> here.  Its got tests, travis-ci peace-of-mind, and has been in production 
>>> on several apps for a few months.
>>>
>>> Enjoy!
>>>
>>  -- 
>> 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