EventBus class abstract

Implementers

Constructors

EventBus({bool isModelBus = false})
Factory constructor for EventBus. Creates an EventBusImpl instance.
factory

Properties

allEventStream → Stream<(EventDTO, bool)>
Stream for all sent events (event DTO, and whether it had a listener or not)
no setter
defaultTopicPathSeparator → String
no setter
handlers → EventBusHandlers
Handler management without casting bus as EventBusHandlers.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isDisposed → bool
true once dispose has been called
no setter
isModelBus → bool
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

currentData<T>({List<String>? paths, String? separator}) → T?
Gets the last data sent to a specific topic.
dispose() → Future<void>
Closes the all-events stream and every node of the bus. Safe to call twice. After dispose the bus is unusable: send/listen/subscribe/setHandler throw StateError.
fire<T>(T data, {List<String>? paths, String? separator, Map<String, String>? arguments}) → bool
Publishes an event to local listeners and forgets about it.
haveHandler<T>({List<String>? paths, String? separator}) → bool
Returns true if the bus contains a handler for the specified topic
haveListener<T>({List<String>? paths, String? separator}) → bool
Returns true if the bus contains a listener for the specified topic
listen<T>({List<String>? paths, String? separator}) → Stream<T>
Listens to events on a specific topic. Returns a Stream of the data type T.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
request<T>(T data, {List<String>? paths, String? separator, Map<String, String>? arguments, Duration? timeout}) → Future
Sends a request and waits for the result of a handler.
subscribe<T>({List<String>? paths, String? separator, void onData(T e)?, Function? onError, void onDone()?, bool? cancelOnError}) → StreamSubscription<T>
Subscribe to events on a specific topic.
toString() → String
A string representation of this object.
inherited

Operators

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