/// <summary> /// Connects to Redis. /// </summary> /// <param name="cancel">A token to cancel the operation.</param> public async Task ConnectAsync(CancellationToken cancel) { _cancel.Cancel(); _cancel.Dispose(); _cancel = new CancellationTokenSource(); _logger.Info("Initiating connections to Redis..."); using (cancel.Register(_cancel.Cancel)) { await Task.WhenAll(_multiplexedCommander.ConnectAsync(_cancel.Token), _subscriptorsPool.ConnectAsync(_cancel.Token), _exclusivePool.ConnectAsync(_cancel.Token) ).ConfigureAwait(false); } _logger.Info("Connections to Redis initiated."); }
public Task ConnectAsync(CancellationToken cancel) { return(_inner.ConnectAsync(cancel)); }