JozzBusService class
A service for publishing and subscribing to domain events.
The JozzBusService provides a central hub for domain event communication in a clean, decoupled way. It uses a broadcast StreamController to allow multiple subscribers to listen to the same event stream.
- Implemented types
- Available extensions
Constructors
- JozzBusService.new()
- Creates a new JozzBusService with a broadcast StreamController.
Properties
Methods
-
autoListen<
T extends JozzEvent> (JozzLifecycleMixin lifecycleOwner, void onData(T)) → JozzBusSubscription< T> -
Available on JozzBus, provided by the JozzBusExtensions extension
Listen to an event and auto-register its subscription with a lifecycle-aware object. -
dispose(
) → void - Closes the underlying StreamController.
-
emit(
JozzEvent event) → void -
Emits a domain event to all subscribers.
override
-
emitEvent(
JozzEvent event) → JozzBus -
Available on JozzBus, provided by the JozzBusExtensions extension
Convenience method to emit events with a fluent API. -
listen<
T extends JozzEvent> (void onData(T)) → JozzBusSubscription< T> -
Available on JozzBus, provided by the JozzBusExtensions extension
Creates a subscription to events of type T. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
on<
T extends JozzEvent> () → Stream< T> -
Returns a stream of domain events of type T.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited