订阅者监听订阅的topic,一旦该topic广播一个通知,订阅者就调用回调函数 var subscription= pubsub.subscribe("inbox/newMessage",messageLogger);发布者负责发布程序感兴趣的topic或通知,例如:pubsub.publish(...
separate events by context or topic.This also makes it trivial to set up and tear down EventBus objects in your tests.Of course,if you'd like to have a process-wide EventBus singleton,there's ...