hoot
Inter-worker message-based communication in the node cluster. Based on this gist.
Install
$ npm install --save hoot
Usage
var hoot = ; // in cluster master when creating workersworker = cluster;hoot; // in workerhoot; hoot;
API
hoot.send(message, data)
Any worker can call send
to broadcast message
to all running workers.
data
can be passed along the message to the listener
hoot.on(message, listener)
Worker registers listener function for each message
separately.
listener
receives message data
as its argument.
hoot.registerWorker(worker)
Cluster master needs to call registerWorker
for all workers that participate in message exchange.
License
MIT © Damian Krzeminski