Lorenzo Tassone
Lorenzo Tassone

Reputation: 383

Node.js events and cluster


I am using Node.js with events-module. I want to use all the cpu-cores, so I have read about cluster-module.
Does these two modules work togheter? If the event is triggered in a different cpu-core?

Thanks for your help.

Upvotes: 0

Views: 1365

Answers (1)

Zuker
Zuker

Reputation: 1083

No, events triggered through Node.js EventEmitter are only fired within one process. You can trigger message event from worker to master process with Cluster API or you can use external message hub i.e. Redis Pub/Sub or RabbitMQ

Upvotes: 2

Related Questions