internal void ReturnClient(IPooledRedisClient pooledRedisClient) { if (DestroyClientCondition(pooledRedisClient)) { pooledRedisClient.Destroy(); } else if (Disposed) { TryDestroyClient(pooledRedisClient); } else { var pool = _pools.GetOrAdd(pooledRedisClient.ConnectionString, k => new ConcurrentQueue <PoolItem>()); if (PoolIsOversized(pool)) { TryDestroyClient(pooledRedisClient); } else { pool.Enqueue(new PoolItem(pooledRedisClient)); } } }
protected virtual void DestroyClient(IPooledRedisClient client) { client.QuitAsync().Wait(_destroyTimeout); client.Destroy(); }
protected virtual void DestroyClient(IPooledRedisClient client) { client.QuitAsync().Wait(_destroyTimeout); client.Destroy(); }
internal void ReturnClient(IPooledRedisClient pooledRedisClient) { if (DestroyClientCondition(pooledRedisClient)) { pooledRedisClient.Destroy(); } else if (Disposed) { TryDestroyClient(pooledRedisClient); } else { var pool = _pools.GetOrAdd(pooledRedisClient.ConnectionString, k => new ConcurrentQueue<PoolItem>()); if (PoolIsOversized(pool)) TryDestroyClient(pooledRedisClient); else pool.Enqueue(new PoolItem(pooledRedisClient)); } }