Package com.couchbase.client.core.event
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 Summary
Constructors Constructor Description DefaultEventBus(rx.Scheduler scheduler)
-
Method Summary
Modifier and Type Method Description rx.Observable<CouchbaseEvent>
get()
Subscribe to the event bus to retrieveCouchbaseEvent
s.boolean
hasSubscribers()
Checks if the event bus has subscribers.void
publish(CouchbaseEvent event)
Publish aCouchbaseEvent
into the bus.
-
Constructor Details
-
DefaultEventBus
public DefaultEventBus(rx.Scheduler scheduler)
-
-
Method Details
-
get
Description copied from interface:EventBus
Subscribe to the event bus to retrieveCouchbaseEvent
s. -
publish
Description copied from interface:EventBus
Publish aCouchbaseEvent
into the bus. -
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 interfaceEventBus
- Returns:
- true if it has subscribers, false otherwise.
-