private void disposeContext() { if (_client != null) { _client.Dispose(); _typedClient.Dispose(); } }
/// <summary> /// Closes the redis target. /// </summary> public override void Close() { _nodeTypeClient.Dispose(); _wayTypeClient.Dispose(); _relationTypeClient.Dispose(); _redisClient.Dispose(); }
/// <summary> /// Disposes of all resource associated with this datasource. /// </summary> public void Dispose() { _clientNode.Dispose(); _clientWay.Dispose(); _clientRelation.Dispose(); _client.Dispose(); }
protected void SendQueueMessage <TEvent>(TEvent evt, string key) where TEvent : IEvent { using (IRedisClient client = DomainHelper.GetClient()) { IRedisTypedClient <TEvent> redis = client.As <TEvent>(); var events = redis.Lists[key]; redis.PushItemToList(events, evt); redis.Dispose(); Logger.InfoFormat("写入队列消息 key:{0}", key); } }