doClose method

  1. @override
Future<void> doClose(
  1. Nyxx client,
  2. Future<void> close(
      )
    )
    override

    Perform the close operation.

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

    Implementation

    @override
    Future<void> doClose(Nyxx client, Future<void> Function() close) async {
      await super.doClose(client, close);
    
      _clients--;
      _stopListeningIfNeeded();
    
      if (client is NyxxRest) {
        _tokens.remove(client.apiOptions.token);
      }
    }