Package com.couchbase.client.core.cnc
Interface EventBus
- All Known Implementing Classes:
DefaultEventBus
,SimpleEventBus
public interface EventBus
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Signals if a publish call was successful and if not why. -
Method Summary
Modifier and TypeMethodDescriptionTry to publish an event.start()
Starts the event bus if it hasn't been started yet.Stops the event bus if it hasn't been stopped already.void
unsubscribe
(EventSubscription subscription)
-
Method Details
-
publish
Try to publish an event.- Parameters:
event
- the event to publish.- Returns:
- the
EventBus.PublishResult
of th event.
-
subscribe
- Parameters:
consumer
- the consumer which will receive events.- Returns:
- a
EventSubscription
that can be used to unsubscribe.
-
unsubscribe
- Parameters:
subscription
- the subscription used.
-
start
Starts the event bus if it hasn't been started yet. -
stop
Stops the event bus if it hasn't been stopped already.
-