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();
 }
Esempio n. 3
0
 protected virtual void DestroyClient(IPooledRedisClient client)
 {
     client.QuitAsync().Wait(_destroyTimeout);
     client.Destroy();
 }
Esempio n. 4
0
 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));
     }
 }