EventBus class abstract
An bus which receives every event from an scope, dispatches them to the correct handler and keeps the last of each cacheable event saved.
Properties
- allEvents → Stream
-
An Stream of every event added to this bus.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- unhandledEvents → Stream
-
An Stream of the events which were not handled by any client of the bus.
no setter
Methods
-
add<
T> (T event) → void -
Add an
eventto the bus. The type argument is needed for caching. -
addError<
E, Event extends IMayThrowAn< (E> >E error) → void -
Add an
errorto the bus That will be sent to the listeners ofEvent. -
close(
) → Future< void> - Close this bus.
-
events<
T extends IAmRetrievable> ({Duration retrieveTimeout = const Duration(milliseconds: 10), Object? argument}) → Stream< T> -
The Stream for the next events of type
T+ the last cached one or an Retrieved one. -
eventsOrErrors<
E, Event extends IAmRetrievableAndMayThrowAn< (E> >{Duration retrieveTimeout = const Duration(milliseconds: 10), Object? argument}) → Stream< Either< E, Event> > -
The Stream for the next events of type
Event+ the last cached one or an Retrieved one or the errors emitted by thisEventtype. Prefer this over events for events which IMayThrowAn. -
nextEvents<
T> () → Stream< T> -
An Stream containing only the next events of type
T. -
nextEventsOrErrors<
E, Event extends IMayThrowAn< (E> >) → Stream< Either< E, Event> > -
An Stream containing only the next events of type
Eventor the errors emitted by thisEventtype. Prefer this over nextEvents for events which IMayThrowAn. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited