/// <summary> /// Release resources used by the current RedisSubscriptionClient /// </summary> public void Dispose() { if (_readCancel != null) { _readCancel.Cancel(); } if (_reader != null) { _reader.Wait(); _reader.Dispose(); } if (_connection != null) { _connection.Dispose(); } if (_callbackDispatchers != null) { _callbackDispatchers.Clear(); } _count = 0; if (_activity != null) { _activity.Dispose(); } _activity = null; }
/// <summary> /// Release resoures used by the current RedisSentinelClient /// </summary> public void Dispose() { if (_connection != null) { _connection.Dispose(); } if (_activity != null) { _activity.Dispose(); } _activity = null; }
/// <summary> /// Release resources used by the current RedisConnection /// </summary> public void Dispose() { if (_asyncTaskQueue != null) { _asyncTaskQueue.CompleteAdding(); } if (_asyncReader != null) { try { _asyncReader.Wait(); } catch (AggregateException ae) { throw ae; } _asyncReader.Dispose(); _asyncReader = null; } if (_asyncTaskQueue != null) { _asyncTaskQueue.Dispose(); _asyncTaskQueue = null; } ActivityTracer.Verbose("Closing connection stream"); if (_stream != null) { _stream.Dispose(); } ActivityTracer.Info("Closing connection"); if (_socket != null) { _socket.Dispose(); } if (_activity != null) { _activity.Dispose(); } _activity = null; }
/// <summary> /// Release resources used by the current RedisClientAsync instance /// </summary> public void Dispose() { if (_connection != null) { _connection.Dispose(); } if (_subscriptionClient.IsValueCreated) { _subscriptionClient.Value.Dispose(); } if (_activity != null) { _activity.Dispose(); } _activity = null; }
public object[] End() { if (!Active) { throw new InvalidOperationException("Not in pipeline mode"); } if (_asTransaction && _transactionhandler.Active) { ExecTransaction(); } _io.Wait(); Active = false; _activity.Dispose(); object[] output = new object[Results.Count]; for (int i = 0; i < output.Length; i++) { output[i] = Results.Dequeue(); } return(output); }
public string Discard() { Active = false; _activity.Dispose(); return(_connection.Call(RedisReader.ReadStatus, "DISCARD")); }