Nodejs EventEmitter 和负载均衡

Nodejs EventEmitter & load balancing

我听到有人说 'EventEmitter becomes an issue the moment you decide to load balance. I haven’t used it in 4 or 5 years because I’m always clustering my Node apps'

'EventEmitter'和'load balance'有关系吗? 是真的吗?

你一定是有什么困惑。 EventEmitter 只是一种工具,用于让人们订阅 notifications/events 并向该特定事件的订阅者发送 notifications/events。很多 node.js 对象使用 `EventEmitters 及其接口。真的跟负载均衡没关系

例如,一个HTTP request object,一个HTTP服务器和一个socket对象都是从一个EventEmitter派生出来的。因此,您在 node.js 中做的很多事情都会一直使用 EventEmitter。

Is there a relationship between 'EventEmitter' and 'load balance'?

没有,没有。