doClose method

  1. @mustCallSuper
Future<void> doClose(
  1. ClientType client,
  2. Future<void> close(
      )
    )

    Perform the close operation.

    People overriding this method should call it to obtain the client instance.

    Implementation

    @mustCallSuper
    Future<void> doClose(ClientType client, Future<void> Function() close) async {
      final state = _states[client];
      await state?.beforeClose(client);
    
      await close();
      _states[client] = null;
    
      await state?.afterClose();
    }