public interface Router
Router is used to route an Object to Consumers.| Modifier and Type | Method and Description |
|---|---|
<E extends Event<?>> |
route(java.lang.Object key,
E data,
java.util.List<Registration<? extends reactor.fn.Consumer<? extends Event<?>>>> consumers,
reactor.fn.Consumer<E> completionConsumer,
reactor.fn.Consumer<java.lang.Throwable> errorConsumer)
Routes the
event, triggered by a notification with the given key to the
consumers. |
<E extends Event<?>> void route(java.lang.Object key, E data, java.util.List<Registration<? extends reactor.fn.Consumer<? extends Event<?>>>> consumers, reactor.fn.Consumer<E> completionConsumer, reactor.fn.Consumer<java.lang.Throwable> errorConsumer)
event, triggered by a notification with the given key to the
consumers. Depending on the router implementation, zero or more of the consumers
will receive the event. Upon successful completion of the event routing, the
completionConsumer will be invoked. completionConsumer may be null. In the
event of an exception during routing the errorConsumer is invoked.
errorConsumer may be null, in which case the exception is swallowed.key - The notification keydata - The Object to routeconsumers - The Consumers to route the event to.completionConsumer - The Consumer to invoke upon successful completion of event routingerrorConsumer - The Consumer to invoke when an error occurs during event routing