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
Subscriptions to be associated with a
specific event.-
Method Summary
Modifier and TypeMethodDescriptionvoidpublishAsync(T t) Publishes the supplied event asynchronously.voidpublishAsync(T t, Consumer<T> onFinish) Publishes the supplied event asynchronously and calls theConsumer<T>when allSubscriptions have been notified.voidPublishes the supplied event asynchronously and calls theConsumer<T>when allSubscriptions 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 allSubscriptions have been notified.- Parameters:
t- the eventonFinish- theConsumer<T>to be called after allSubscriptions have been notified
-
publishAsync
Publishes the supplied event asynchronously and calls theConsumer<T>when allSubscriptions have been notified. Additionally, this notifies for every exception thrown in the process.- Parameters:
t- the eventonFinish- theConsumerto be called after allSubscriptions have been notifiedonException- theConsumerwhich is notified for each exception thrown
-