AgentController class
A flexible controller based on EventBus. It wraps an EventBus and provides helper methods to interact with it.
Constructors
- AgentController({EventBus? eventBus})
Properties
Methods
-
close(
) → void - Closes the underlying event bus.
-
listen<
T extends Event> () → Stream< T> -
Listens to events of type
T. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
on<
T extends Event> (void handler(T)) → void -
publish(
Event event) → void - Publishes an event (notification).
-
registerHandler<
T extends Event, R> (Future< R> handler(T)) → void -
request<
T extends Event, R> (T event, R defaultValue) → Future< R> -
Sends a request and waits for a response.
If no handler is registered,
defaultValueis returned immediately (non-blocking). -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited