Class DefaultEventBus

java.lang.Object
com.couchbase.client.core.event.DefaultEventBus
All Implemented Interfaces:
EventBus

public class DefaultEventBus
extends Object
implements EventBus
The default event bus implementation.
Since:
1.1.0
Author:
Michael Nitschinger
  • Constructor Details

    • DefaultEventBus

      public DefaultEventBus​(rx.Scheduler scheduler)
  • Method Details

    • get

      public rx.Observable<CouchbaseEvent> get()
      Description copied from interface: EventBus
      Subscribe to the event bus to retrieve CouchbaseEvents.
      Specified by:
      get in interface EventBus
      Returns:
      the observable where the events are emitted into.
    • publish

      public void publish​(CouchbaseEvent event)
      Description copied from interface: EventBus
      Publish a CouchbaseEvent into the bus.
      Specified by:
      publish in interface EventBus
      Parameters:
      event - the event to publish.
    • hasSubscribers

      public boolean hasSubscribers()
      Description copied from interface: EventBus
      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.
      Specified by:
      hasSubscribers in interface EventBus
      Returns:
      true if it has subscribers, false otherwise.