请求应答模式

EventBus bus;

bus.on($("reply.sink"), ev -> {
  System.out.printf("Got %s on thread %s%n", ev, Thread.currentThread())
}); 

bus.receive($("job.sink"), ev -> {
  return doWork(ev);
}); 

bus.send("job.sink", Event.wrap("Hello World!", "reply.sink")); 
EventBus bus;

bus.receive($("job.sink"), (Event<String> ev) -> {
  return ev.getData().toUpperCase();
}); 

bus.sendAndReceive(
    "job.sink",
   Event.wrap("Hello World!"),
   s -> System.out.printf("Got %s on thread %s%n", s, Thread.currentThread())
); 
EventBus bus;

Registration reg = bus.on($("topic"),
                          s -> System.out.printf("Got %s on thread %s%n", s, Thread.currentThread()));

bus.notify("topic", Event.wrap("Hello World!")); 

// ...some time later...
reg.cancel(); 

// ...some time later...
bus.notify("topic", Event.wrap("Hello World!"));