Interface IEventPublisher

All Superinterfaces:
Flow.Publisher<Event>

public interface IEventPublisher extends Flow.Publisher<Event>

Interface for event publishers accepting subscriptions of simple listeners as well as subscribers with flow control support.

  • Method Details

    • publish

      void publish(Event e)
      Dispatch event to all subscribers
      Parameters:
      e - event to dispatch
    • publish

      void publish(Event e, BiPredicate<Flow.Subscriber<? super Event>,? super Event> onDrop)
      Dispatch event to all subscribers and provide onDrop callback.

      An event can be dropped by a subscriber when it cannot keep up with the publisher rate and its delivery buffer has reached maximum capacity.

      Parameters:
      e - event to dispatch
      onDrop - called when event was dropped by a subscriber
    • getNumberOfSubscribers

      int getNumberOfSubscribers()
      Returns:
      the number of current subscribers