Interface AsyncPublisher<T>

Type Parameters:
T -
All Superinterfaces:
Publisher<T>
All Known Implementing Classes:
ConcurrentLockedPublisher

public interface AsyncPublisher<T> extends Publisher<T>
Used to implement a publish/subscribe system. This allows multiple Subscriptions to be associated with a specific event.
  • Method Details

    • publishAsync

      void publishAsync(T t)
      Publishes the supplied event asynchronously.
      Parameters:
      t - the event
    • publishAsync

      void publishAsync(T t, Consumer<T> onFinish)
      Publishes the supplied event asynchronously and calls the Consumer<T> when all Subscriptions have been notified.
      Parameters:
      t - the event
      onFinish - the Consumer<T> to be called after all Subscriptions have been notified
    • publishAsync

      void publishAsync(T t, Consumer<T> onFinish, Consumer<Throwable> onException)
      Publishes the supplied event asynchronously and calls the Consumer<T> when all Subscriptions have been notified. Additionally, this notifies for every exception thrown in the process.
      Parameters:
      t - the event
      onFinish - the Consumer to be called after all Subscriptions have been notified
      onException - the Consumer which is notified for each exception thrown