Interface AsyncPublisher<T>
- Type Parameters:
T
-
- All Superinterfaces:
Publisher<T>
- All Known Implementing Classes:
ConcurrentLockedPublisher
Used to implement a publish/subscribe system. This allows multiple
Subscription
s to be associated with a
specific event.-
Method Summary
Modifier and TypeMethodDescriptionvoid
publishAsync
(T t) Publishes the supplied event asynchronously.void
publishAsync
(T t, Consumer<T> onFinish) Publishes the supplied event asynchronously and calls theConsumer<T>
when allSubscription
s have been notified.void
Publishes the supplied event asynchronously and calls theConsumer<T>
when allSubscription
s have been notified.
-
Method Details
-
publishAsync
Publishes the supplied event asynchronously.- Parameters:
t
- the event
-
publishAsync
Publishes the supplied event asynchronously and calls theConsumer<T>
when allSubscription
s have been notified.- Parameters:
t
- the eventonFinish
- theConsumer<T>
to be called after allSubscription
s have been notified
-
publishAsync
Publishes the supplied event asynchronously and calls theConsumer<T>
when allSubscription
s have been notified. Additionally, this notifies for every exception thrown in the process.- Parameters:
t
- the eventonFinish
- theConsumer
to be called after allSubscription
s have been notifiedonException
- theConsumer
which is notified for each exception thrown
-