Constructors
EventBus ({bool isModelBus = false })
Factory constructor for EventBus.
Creates an EventBusImpl instance.
factory
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