Package com.couchbase.client.core.cnc
Interface EventBus
- All Known Implementing Classes:
DefaultEventBus,SimpleEventBus
public interface EventBus
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classEventBus.PublishResultSignals if a publish call was successful and if not why. -
Method Summary
Modifier and Type Method Description EventBus.PublishResultpublish(Event event)Try to publish an event.Mono<Void>start()Starts the event bus if it hasn't been started yet.Mono<Void>stop(Duration timeout)Stops the event bus if it hasn't been stopped already.EventSubscriptionsubscribe(Consumer<Event> consumer)voidunsubscribe(EventSubscription subscription)
-
Method Details
-
publish
Try to publish an event.- Parameters:
event- the event to publish.- Returns:
- the
EventBus.PublishResultof th event.
-
subscribe
- Parameters:
consumer- the consumer which will receive events.- Returns:
- a
EventSubscriptionthat 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.
-