Class AbstractPublisher<T>

java.lang.Object
dev.getelements.elements.sdk.util.AbstractPublisher<T>
Type Parameters:
T - the type published
All Implemented Interfaces:
Publisher<T>
Direct Known Subclasses:
ConcurrentDequePublisher, LinkedPublisher

public abstract class AbstractPublisher<T> extends Object implements Publisher<T>
Represents an abstract Publisher instance.
  • Field Details

    • logger

      protected final org.slf4j.Logger logger
  • Constructor Details

    • AbstractPublisher

      public AbstractPublisher(Class<?> cls)
    • AbstractPublisher

      public AbstractPublisher(org.slf4j.Logger logger)
  • Method Details

    • publish

      public void publish(T t)
      Description copied from interface: Publisher
      Publishes the event synchronously.
      Specified by:
      publish in interface Publisher<T>
      Parameters:
      t - the event
    • publish

      public void publish(T t, Consumer<? super T> onFinish)
      Description copied from interface: Publisher
      Publishes the supplied event synchronously and calls the Consumer when all Subscriptions have been notified.
      Specified by:
      publish in interface Publisher<T>
      Parameters:
      t - the event
      onFinish - the Consumer to be called after all Subscriptions have been notified
    • logException

      protected void logException(Throwable th)
    • handleException

      protected void handleException(Consumer<Throwable> onException, Throwable th)