@Stability.Internal public class SimpleEventBus extends Object implements EventBus
EventBus.PublishResult| Constructor and Description |
|---|
SimpleEventBus(boolean ignoreSystemEvents)
Creates a new
SimpleEventBus. |
SimpleEventBus(boolean ignoreSystemEvents,
List<Class<? extends Event>> othersToIgnore)
Creates a new
SimpleEventBus. |
| Modifier and Type | Method and Description |
|---|---|
EventBus.PublishResult |
publish(Event event)
Try to publish an event.
|
List<Event> |
publishedEvents() |
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)
|
public SimpleEventBus(boolean ignoreSystemEvents)
SimpleEventBus.
Note that in general you want to ignore system events since they add nondeterminism during assertions when things like garbage collections happen. Of course if you need to test/verify system events, set the argument to false.
ignoreSystemEvents - true if they should be ignored (recommended), false otherwise.public SimpleEventBus(boolean ignoreSystemEvents,
List<Class<? extends Event>> othersToIgnore)
SimpleEventBus.
Note that in general you want to ignore system events since they add nondeterminism during assertions when things like garbage collections happen. Of course if you need to test/verify system events, set the argument to false.
ignoreSystemEvents - true if they should be ignored (recommended), false otherwise.othersToIgnore - other list of events to ignore.public EventBus.PublishResult publish(Event event)
EventBuspublish in interface EventBusevent - the event to publish.EventBus.PublishResult of th event.public EventSubscription subscribe(Consumer<Event> consumer)
EventBussubscribe in interface EventBusconsumer - the consumer which will receive events.EventSubscription that can be used to unsubscribe.public void unsubscribe(EventSubscription subscription)
EventBusunsubscribe in interface EventBussubscription - the subscription used.public Mono<Void> start()
EventBusCopyright © 2021 Couchbase, Inc.. All rights reserved.