public interface Observable
| Modifier and Type | Method and Description |
|---|---|
<T> Consumer<java.lang.Iterable<Event<T>>> |
batchNotify(java.lang.Object key)
Notify the key with all any accepted iterable group of events by the returned
Consumer. |
<T> Consumer<java.lang.Iterable<Event<T>>> |
batchNotify(java.lang.Object key,
Consumer<java.lang.Void> consumer)
Notify the key with all any accepted iterable group of events by the returned
Consumer. |
Observable |
notify(java.lang.Object key)
Notify this component that the consumers registered with a
Selector that matches the key should be
triggered with a null input argument. |
<E extends Event<?>> |
notify(java.lang.Object key,
E ev)
Notify this component that an
Event is ready to be processed. |
<E extends Event<?>> |
notify(java.lang.Object key,
E ev,
Consumer<E> onComplete)
|
<S extends Supplier<? extends Event<?>>> |
notify(java.lang.Object key,
S supplier)
Notify this component that the given
Supplier can provide an event that's ready to be
processed. |
<E extends Event<?>> |
on(Selector sel,
Consumer<E> consumer)
|
<T> Consumer<Event<T>> |
prepare(java.lang.Object key)
Create an optimized path for publishing notifications to the given key.
|
<E extends Event<?>,V> |
receive(Selector sel,
Function<E,V> fn)
|
boolean |
respondsToKey(java.lang.Object key)
|
<E extends Event<?>> |
send(java.lang.Object key,
E ev)
|
<E extends Event<?>> |
send(java.lang.Object key,
E ev,
Observable replyTo)
Notify this component of the given
Event and register an internal Consumer that will take the
output of a previously-registered Function and respond to the key set on the Event's replyTo property and will call the notify method on the given Observable. |
<S extends Supplier<? extends Event<?>>> |
send(java.lang.Object key,
S supplier)
|
<S extends Supplier<? extends Event<?>>> |
send(java.lang.Object key,
S supplier,
Observable replyTo)
|
<REQ extends Event<?>,RESP extends Event<?>> |
sendAndReceive(java.lang.Object key,
REQ ev,
Consumer<RESP> reply)
|
<REQ extends Event<?>,RESP extends Event<?>,S extends Supplier<REQ>> |
sendAndReceive(java.lang.Object key,
S supplier,
Consumer<RESP> reply)
|
boolean respondsToKey(java.lang.Object key)
key - The key to be matched by Selectors<E extends Event<?>> Registration<Consumer<E>> on(Selector sel, Consumer<E> consumer)
E - The type of the Eventsel - The Selector to be used for matchingconsumer - The Consumer to be triggeredRegistration object that allows the caller to interact with the given mapping<E extends Event<?>,V> Registration<Consumer<E>> receive(Selector sel, Function<E,V> fn)
E - The type of the EventV - The type of the response datasel - The Selector to be used for matchingfn - The transformative Function to call to receive an EventRegistration object that allows the caller to interact with the given mapping<E extends Event<?>> Observable notify(java.lang.Object key, E ev, Consumer<E> onComplete)
<E extends Event<?>> Observable notify(java.lang.Object key, E ev)
Event is ready to be processed.<S extends Supplier<? extends Event<?>>> Observable notify(java.lang.Object key, S supplier)
Supplier can provide an event that's ready to be
processed.<E extends Event<?>> Observable send(java.lang.Object key, E ev)
<S extends Supplier<? extends Event<?>>> Observable send(java.lang.Object key, S supplier)
<E extends Event<?>> Observable send(java.lang.Object key, E ev, Observable replyTo)
Event and register an internal Consumer that will take the
output of a previously-registered Function and respond to the key set on the Event's replyTo property and will call the notify method on the given Observable.E - The type of the Eventkey - The key to be matched by Selectorsev - The EventreplyTo - The Observable on which to invoke the notify method<S extends Supplier<? extends Event<?>>> Observable send(java.lang.Object key, S supplier, Observable replyTo)
Supplier will provide an Event and register an internal Consumer that will take the output of a previously-registered Function and respond to the key set on the
Event's replyTo property and will call the notify method on the given Observable.S - The type of the Supplierkey - The key to be matched by Selectorssupplier - The Supplier that will provide the actual Event instancereplyTo - The Observable on which to invoke the notify method<REQ extends Event<?>,RESP extends Event<?>> Observable sendAndReceive(java.lang.Object key, REQ ev, Consumer<RESP> reply)
Consumer on an anonymous Selector and
set the given event's replyTo property to the corresponding anonymous key, then register the consumer to
receive replies from the Function assigned to handle the given key.REQ - The type of the request event.RESP - The type of the response event.key - The key to be matched by Selectorsev - The event to notify.reply - The consumer to register as a reply handler.<REQ extends Event<?>,RESP extends Event<?>,S extends Supplier<REQ>> Observable sendAndReceive(java.lang.Object key, S supplier, Consumer<RESP> reply)
Consumer on an anonymous Selector and
set the event's replyTo property to the corresponding anonymous key, then register the consumer to receive
replies from the Function assigned to handle the given key.REQ - The type of the request event.RESP - The type of the response event.S - The type of the supplier.key - The key to be matched by Selectorssupplier - The supplier to supply the event.reply - The consumer to register as a reply handler.Observable notify(java.lang.Object key)
Selector that matches the key should be
triggered with a null input argument.key - The key to be matched by Selectors<T> Consumer<Event<T>> prepare(java.lang.Object key)
<T> Consumer<java.lang.Iterable<Event<T>>> batchNotify(java.lang.Object key)
Consumer. The implementation
will take care of reducing the consumer selection to one per batch. The candidate consumers are selected with the
key , possibly on each batch to refresh the result list.<T> Consumer<java.lang.Iterable<Event<T>>> batchNotify(java.lang.Object key, Consumer<java.lang.Void> consumer)
Consumer. The implementation
will take care of reducing the consumer selection to one per batch. The candidate consumers are selected with the
key , possibly on each batch to refresh the result list.