Node.js asynchronous event emitter
NodeJS的events library只提供synchronous emit。
为event添加的listener可使用setImmediate()等使其成为async listener,但emit仍为synchronous。(参考NodeJS manual)
emitterylibrary(不基于events)使用Promise.all()使emit成为async emit,同时使用map()使任何listener都变成async listener。
asynchronous-emitter..
原创
2020-07-31 22:30:40 ·
249 阅读 ·
0 评论