The event interface is simple.

I module X emit an event. module Y listens to the event and does something.

module Y does NOT in whatever way or form return a value from the event.
Event emitters are not a bidirectional communication channel. They are a
single direction communication channel.

module Y does NOT return a value or an error through a callback you emit on
the event. Doing so is doing RPC. `foo.emit("doSomething", data, function
(err) { ... })` is wrong and should be `foo.doSomething(data, function
(err) { ... })`

The most important thing is that event emitters is a single direction
communication. If you want bidirectional communication use a duplex stream
or functions

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