event_bus_arch library
Classes
- AddressMetricsSnapshot
- One topic in a metrics snapshot.
- CancelToken
- A cooperative cancellation signal for EventBus.request.
- EventAddress
- The stable address of an event.
- EventBus
- EventBusCapabilities
- Compile-time platform capabilities of the package.
- EventBusError
- One observable bus failure.
- EventBusErrorMonitor
- An aggregator over the error streams of several buses.
- EventBusErrorSnapshot
- A consistent view of a monitor's counters and its bounded recent buffer.
- EventBusImpl
- EventBusIsolate
- Atention The result of calling the event can be received later than the events called in the event handler on the isolate side
- EventBusLogger
- EventBusMetrics
- Metric collection for one bus.
- EventBusMetricsExporter
- The seam for an external exporter (OpenTelemetry, Prometheus, a dashboard).
- EventBusMetricsSnapshot
- An immutable point-in-time view of one bus.
-
EventDTO<
T> - One event: its typed key (address plus local type), the data, the call arguments and an optional correlation id.
-
EventDTOImpl<
T> -
EventKey<
T> -
A typed exact address: the unit passed to
fire,request,currentDataand the other exact operations. -
EventNode<
T> - A node holds the current value of a topic and the stream of its listeners. Request handlers are registered on the bus, not on the node.
-
EventNodeImp<
T> - EventNodeImp stores the current value and fans events out to listeners.
- EventPattern
- A wildcard address used to select a set of EventAddress values.
-
EventPatternKey<
T> -
A typed wildcard selector: the unit passed to
listen/subscribe. -
EventSelector<
T> - A selector of events: an exact EventKey or an EventPatternKey.
-
EventSubscription<
T> - A consumer registration created by EventBus.subscribe.
- IncomingEventNode
- A node that can receive an event from a transport and deliver it to local listeners without publishing it back to the transport.
- KeepAliveNode
- A node that must survive the last listener: a transport keeps an incoming subscription on it.
- LatencySnapshot
- A fixed-bucket latency histogram as seen in a metrics snapshot.
- Layer
- Layers
- LayerSpec
- The description of one layer in a Layers chain.
- LayersSupervisor
- Owns a supervised layer chain. Created by Layers.supervise.
- ObservabilityConfig
- Observability switches, configured once at bus construction.
-
SubscriptionHost<
T> - A node that can host EventSubscriptions.
- SubscriptionMetricsSnapshot
- One subscription in a metrics snapshot.
- SupervisionPolicy
- Restart limits and backoff for a supervised worker.
- WorkerMetrics
- Counters of one worker slot.
- WorkerPool
- A fixed set of N EventBusIsolates with one dispatch strategy and supervision.
- WorkerPoolMetrics
- A snapshot of the pool counters.
Enums
- BufferOverflow
- What a listener subscription does when its buffer is full.
- DeliveryMode
- When a listener callback is invoked relative to the publisher.
- DispatchStrategy
- How WorkerPool chooses a worker for an event or a request.
- EventBusErrorKind
- The category of an EventBusError.
- EventBusErrorSource
- Where an EventBusError came from.
- LayersState
- Lifecycle of a LayersSupervisor.
- RequestOutcome
- What happened to one request, for metrics.
- WorkerPoolState
- Lifecycle of a WorkerPool.
Mixins
Typedefs
- EventBusErrorFilter = bool Function(EventBusError error)
- A predicate that decides whether the monitor accepts an error.
-
EventCallback<
T> = FutureOr< void> Function(T event) - The callback of a listener subscription.
-
Handler<
T> = Future Function(EventDTO< T> dto, T? lastData) - Handler function type for request responders.
-
LayerInit
= FutureOr<
void> Function(Layer, Object? initialData) - Layer init function. It runs INSIDE the layer isolate, so it must be top-level/static. It may be async: the layer is considered initialized only after it returns.
- LoggerHandler = void Function(EventDTO dto, bool hasListeners)
- MetricKeyBuilder = String Function(String address)
- Builds the metrics key of an event address.
-
Node<
T> = EventNode< T> - Alias for EventNode type
-
WorkerInit
= FutureOr<
void> Function(EventBus bus, Object? initialData) - The worker init function of a WorkerPool. Like EventBusIsolate.onInit, it runs INSIDE the worker isolate and must be top-level or static.
- WorkerKeySelector = Object? Function(EventDTO dto)
- A process-wide key selector for DispatchStrategy.keyed.
Exceptions / Errors
- BusyException
- A request matched handler subscriptions, but none had a free slot or queue room, or all matching handlers were paused.
- EventBusException
- The exception type of the package: an invalid topic, an invalid request address, or an isolate exchange failure.
- NoHandlerException
- A EventBus.request had no handler to answer it.
- RequestCanceledException
- A request was cancelled by its caller.
- RequestTimeoutException
- A request did not complete within its timeout.