EventBusImpl class

Mixed-in types
Implementers

Constructors

EventBusImpl(bool _isModelBus, {ObservabilityConfig observability = ObservabilityConfig.disabled})
Creates an EventBusImpl instance. If isModelBus is true, the bus behaves as a model bus.

Properties

allEventStream → Stream<(EventDTO, bool)>
Stream for all sent events (event DTO, and whether it had a listener or not)
no setterinherited
errors → Stream<EventBusError>
Bus failures as data. The stream never carries stream errors.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
isDisposed → bool
true once dispose has been called
no setterinherited
isModelBus → bool
no setteroverride
isObservable → bool
True when observability is enabled for this bus.
no setterinherited
metrics → EventBusMetrics
The metric collector of this bus. Safe to read when observability is off: the snapshot is empty in that case.
no setterinherited
observabilityConfig → ObservabilityConfig
Observability switches of this bus; supplied by the concrete bus.
final
recentErrors → List<EventBusError>
The latest errors, bounded (100 entries).
no setterinherited
requestQueueCapacity ↔ int
Default requestQueueCapacity for handler subscriptions created without an explicit override.
getter/setter pairinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
suppressedErrors → int
Errors suppressed by the per-kind/topic rate limit.
no setterinherited

Methods

createNode<T>({required String address, T? currentData}) → EventNode<T>
Creates the node for an address.
inherited
createNodeForKey<T>({required EventKey<T> key, T? currentData}) → EventNode<T>
Creates the node for an exact E key.
inherited
createPatternNodeForKey<T>({required EventPatternKey<T> key, T? currentData}) → EventNode<T>
Creates the node for a typed pattern key.
inherited
currentData<T>(EventSelector<T> selector) → T?
The value stored for a selector: an exact key or a pattern key.
inherited
dispose() → Future<void>
Closes the all-events stream and every node of the bus. Safe to call more than once; after dispose the bus throws StateError on use.
inherited
fire<T>(EventKey<T> key, T data, {Map<String, String>? arguments, String? correlationId}) → bool
Publishes data on an exact typed key.
inherited
handleIncomingRequest(EventDTO dto, {CancelToken? cancelToken}) → Future
Dispatches a request received from another process, for example a transport. The handler is resolved exactly like a local request.
inherited
handlerAddressFor(String address) → String?
The registered address of the tier that would answer address, or null when no handler exists.
inherited
haveAvailableHandler<T>(EventSelector<T> selector) → bool
Whether a handler for the selector could accept a request now.
inherited
haveHandler<T>(EventSelector<T> selector) → bool
Whether a selector has a handler, including paused handlers.
inherited
haveListener<T>(EventSelector<T> selector) → bool
Whether a selector has a listener.
inherited
listen<T>(EventSelector<T> selector) → Stream<T>
Listens to a typed exact or pattern selector.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove<T>(EventSelector<T> selector) → bool
Removes one type node for an exact or pattern selector.
inherited
removeAddress(EventAddress address) → bool
Removes every type node registered at an exact address.
inherited
reportError(EventBusError error) → void
Publishes a bus error. Transport and isolate adapters use this seam.
inherited
request<T>(EventKey<T> key, T data, {Map<String, String>? arguments, Duration? timeout, CancelToken? cancelToken, String? correlationId}) → Future
Sends a request on an exact typed key and waits for the handler result.
inherited
shouldCreateNodeOnSend(String address) → bool
Whether send should create a node when the topic has none.
inherited
shouldCreateNodeOnSendKey<T>(EventKey<T> key) → bool
Whether a send on an exact E key should create a node.
inherited
subscribe<T>(EventSelector<T> selector, {EventCallback<T>? onEvent, Handler<T>? handler, T? initialData, int handlerConcurrency = 1, int? requestQueueCapacity, int? bufferCapacity, BufferOverflow bufferOverflow = BufferOverflow.dropOldest, DeliveryMode deliveryMode = DeliveryMode.async, void onError(Object error, StackTrace? stackTrace)?, void onDone()?, bool cancelOnError = false}) → EventSubscription<T>
Creates a listener and/or handler subscription for a typed selector.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited