Interface EventBus

All Known Implementing Classes:
DefaultEventBus

public interface EventBus
Defines the interface for a generic event bus.
Since:
1.1.0
Author:
Michael Nitschinger
  • Method Details

    • get

      rx.Observable<CouchbaseEvent> get()
      Subscribe to the event bus to retrieve CouchbaseEvents.
      Returns:
      the observable where the events are emitted into.
    • publish

      void publish​(CouchbaseEvent event)
      Publish a CouchbaseEvent into the bus.
      Parameters:
      event - the event to publish.
    • hasSubscribers

      boolean hasSubscribers()
      Checks if the event bus has subscribers. This method can be utilized on the publisher side to avoid complex event creation when there is no one on the other side listening and the event would be discarded immediately afterwards.
      Returns:
      true if it has subscribers, false otherwise.