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 class
EventBus.PublishResult
Signals if a publish call was successful and if not why.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description EventBus.PublishResult
publish(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.EventSubscription
subscribe(Consumer<Event> consumer)
void
unsubscribe(EventSubscription subscription)
-
-
-
Method Detail
-
publish
EventBus.PublishResult publish(Event event)
Try to publish an event.- Parameters:
event
- the event to publish.- Returns:
- the
EventBus.PublishResult
of th event.
-
subscribe
EventSubscription subscribe(Consumer<Event> consumer)
- Parameters:
consumer
- the consumer which will receive events.- Returns:
- a
EventSubscription
that can be used to unsubscribe.
-
unsubscribe
void unsubscribe(EventSubscription subscription)
- Parameters:
subscription
- the subscription used.
-
-