public interface EventBus
| Modifier and Type | Method and Description |
|---|---|
reactor.core.publisher.Flux<Event> |
get()
Deprecated.
since 7.8, use
subscribe(Consumer) or subscribe(Class, Consumer) instead; scheduled for
removal in Lettuce 8.0. To obtain a Flux from the callback API, bridge it yourself:
Flux.create(sink -> {
Subscription s = eventBus.subscribe(sink::next);
sink.onDispose(s::close);
}, FluxSink.OverflowStrategy.DROP);
|
void |
publish(Event event)
Publish a
Event to the bus. |
default <T extends Event> |
subscribe(Class<T> type,
Consumer<T> listener)
Subscribes to
Events of a given type published to the bus. |
default Subscription |
subscribe(Consumer<Event> listener)
Subscribes to all
Events published to the bus. |
@Deprecated reactor.core.publisher.Flux<Event> get()
subscribe(Consumer) or subscribe(Class, Consumer) instead; scheduled for
removal in Lettuce 8.0. To obtain a Flux from the callback API, bridge it yourself:
Flux.create(sink -> {
Subscription s = eventBus.subscribe(sink::next);
sink.onDispose(s::close);
}, FluxSink.OverflowStrategy.DROP);
Events. The Flux drops events on backpressure to avoid contention.void publish(Event event)
Event to the bus.event - the event to publishdefault Subscription subscribe(Consumer<Event> listener)
Events published to the bus. The listener is invoked for every event until the returned
Subscription is closed. Events are dropped on backpressure to avoid contention.
Exceptions thrown by the listener are caught and logged so that a single failing invocation does not cancel the
subscription or affect delivery to other subscribers.listener - callback invoked with each published event, must not be null.Subscription that stops delivery when closed.default <T extends Event> Subscription subscribe(Class<T> type, Consumer<T> listener)
Events of a given type published to the bus. The listener is invoked for every
event assignable to type until the returned Subscription is closed.T - the event type.type - the event type to receive, must not be null.listener - callback invoked with each matching event, must not be null.Subscription that stops delivery when closed.Copyright © 2026 lettuce.io. All rights reserved.