public static void Dispose() { if (prcm != null) { prcm.Dispose(); } }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> /// 时间:2016/8/4 15:54 /// 备注: public void Dispose() { if (PRM != null) { PRM.Dispose(); } }
private bool ConnectToRedis() { var redisDB = MasterServerSettings.Default.RedisDB.Trim(); if (string.IsNullOrWhiteSpace(redisDB)) { log.InfoFormat("Application {0}/{1} starts without Redis", this.ApplicationId, this.Version); return(false); } PooledRedisClientManager manager = null; try { manager = new PooledRedisClientManager(redisDB); using (var client = manager.GetDisposableClient <RedisClient>()) { client.Client.Ping(); } this.redisManager = manager; } catch (Exception e) { if (manager != null) { manager.Dispose(); } log.WarnFormat("Exception through connection to redis at '{0}'. Will continue without Redis", redisDB); log.WarnFormat("Exception: {0}", e); return(false); } return(true); }
public void dispose() { if (_prcm != null) { _prcm.Dispose(); _prcm = null; //销毁对象 } }
public void Dispose() { clientManager.Dispose(); if (clientFactory.IsValueCreated) { clientFactory.Value.Dispose(); } }
public void Close() { try { if (redisManager != null) { redisManager.Dispose(); } } catch { } }
/// <summary> /// 释放 /// </summary> public void Dispose() { if (_Redis != null) { _Redis.Dispose(); _Redis = null; } if (conn != null) { conn.Dispose(); conn = null; } }
/// <summary> /// 关闭客户端连接 /// </summary> /// <returns></returns> public bool Close() { var result = true; try { _cachePool.Dispose(); } catch { result = false; } return(result); }
public void Dispose() { clientManager.Dispose(); }
public void Close() { var client = prcm.GetClient(); prcm.Dispose(); }
public void Dispose() { _clientManager?.Dispose(); }