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
All Methods Instance Methods Abstract Methods 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 Detail
-
publish
EventBus.PublishResult publish(Event event)
Try to publish an event.- Parameters:
event- the event to publish.- Returns:
- the
EventBus.PublishResultof th event.
-
subscribe
EventSubscription subscribe(Consumer<Event> consumer)
- Parameters:
consumer- the consumer which will receive events.- Returns:
- a
EventSubscriptionthat can be used to unsubscribe.
-
unsubscribe
void unsubscribe(EventSubscription subscription)
- Parameters:
subscription- the subscription used.
-
-