ConnectionPool class
Maintains a pool of Connections shared across multiple MediatorClients,
enabling concurrent WebSocket usage and reusing existing connections.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
connect(
{required MediatorClient mediatorClient, required void onMessage(Map< String, dynamic> ), OnReconnectingCallback? onReconnecting, OnReconnectedCallback? onReconnected, Function? onError, void onDone({int? closeCode, String? closeReason})?, bool? cancelOnError}) → StreamSubscription - Connects to a MediatorClient and subscribes to its message stream.
-
disconnect(
{required MediatorClient mediatorClient}) → Future< void> -
Disconnects a MediatorClient from its associated
Connectionand cancels its subscription. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
startConnections(
) → Future< void> - Starts all connections in the pool.
-
stopConnections(
) → Future< void> - Cancels all subscriptions in the pool and stops all connections.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → ConnectionPool
-
The singleton instance of ConnectionPool.
final