BridgeEventDispatcher class

BridgeEventDispatcher implements the upstream dispatch semantics for the bridge.

It emits two streams:

  • internalSessions: receives the internal/session event first
  • events: receives each alias member as a separate event

The bot parameter must have platform, userId, and login getters (as SatoriBot does). Any object satisfying this interface works.

Usage:

final dispatcher = BridgeEventDispatcher(bot);
dispatcher.internalSessions.listen((session) => ...);
dispatcher.events.listen((event) => ...);
dispatcher.dispatch(session);

Constructors

BridgeEventDispatcher(SatoriBot bot)
Creates a dispatcher for bot.

Properties

events → Stream<Event>
Stream of regular events, one per alias member (including canonical).
no setter
hashCode → int
The hash code for this object.
no setterinherited
internalSessions → Stream<Session>
Stream of internal/session events, emitted BEFORE alias-group events.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → Future<void>
Closes both streams and releases resources.
dispatch(Session session) → void
Dispatches session through the bridge event pipeline.
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