protected override void OnDispose(bool disposing) { Interlocked.Exchange(ref MonitorCompleted, null); Interlocked.Exchange(ref PubSubCompleted, null); Interlocked.Exchange(ref PubSubPulseStateChanged, null); Interlocked.Exchange(ref PoolPulseStateChanged, null); if (m_ProbeAttached) { RedisCardio.Default.Detach(this); } RedisConnectionPool.Unregister(this); CloseMemberStore(); base.OnDispose(disposing); StopToProcessQ(); var monitorChannel = Interlocked.Exchange(ref m_MonitorChannel, null); if (monitorChannel != null) { monitorChannel.Dispose(); } var pubSubChannel = Interlocked.Exchange(ref m_PubSubChannel, null); if (pubSubChannel != null) { pubSubChannel.Dispose(); } }
private static void Unregister(RedisConnectionPool pool) { lock (s_PoolLock) { s_Pools.Remove(pool); if (s_Pools.Count == 0) { var timer = Interlocked.Exchange(ref s_PurgeTimer, null); if (timer != null) { timer.Dispose(); } } } }
private static void Register(RedisConnectionPool pool) { lock (s_PoolLock) { s_Pools.Add(pool); if (s_PurgeTimer == null) { s_PurgeTimer = new Timer((state) => { var pools = GetPoolList(); if (!pools.IsEmpty()) { pools.AsParallel().ForAll(p => p.PurgeIdles()); } }, null, RedisConstants.ConnectionPurgePeriod, RedisConstants.ConnectionPurgePeriod); } } }
public RedisBatch(RedisConnectionPool pool, int dbIndex, bool throwOnError = true) : base(pool, dbIndex, throwOnError) { }
public RedisPoolClient(RedisConnectionPool pool, bool throwOnError = true) : base(throwOnError) { m_Pool = pool; }
public RedisDb(RedisConnectionPool pool, int dbIndex, bool throwOnError = true) : base(pool, throwOnError) { m_DbIndex = Math.Min(Math.Max(dbIndex, RedisConstants.UninitializedDbIndex), RedisConstants.MaxDbIndex); }