dispose method

  1. @protected
  2. @mustCallSuper
Future<void> dispose([
  1. Object? error,
  2. StackTrace? stackTrace
])

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(),
  ]);
}