/// <inheritdoc/> public async Task StopAsync(CancellationToken token) { if (!isRunning) { return; } tokenSource.Cancel(); await connection.StopAsync(token); isRunning = false; }
public async ValueTask StopAsync() { if (!_isRunning) { return; } _connection.Dispatch -= Dispatch; _tokenSource.Cancel(); await _connection.StopAsync(); _isRunning = false; }