dispose method
Disposes of all the acquired resources:
- Complete pending requests with
error. - Close subsscription listeners.
- Disconnect web socket.
Implementation
@protected
@mustCallSuper
Future<void> dispose([final Object? error, final StackTrace? stackTrace]) {
webSocketExchangeManager.dispose(error, stackTrace);
return Future.wait([
webSocketSubscriptionManager.dispose(),
socket.disconnect(),
]);
}