/// <summary> /// 移除处理程序 /// </summary> /// <param name="QueueName"></param> public void RemoveQueue(string QueueName) { //var Handler = DicQueue[QueueName]; ReceivedQueueHandler Handler = null; DicQueue.Remove(QueueName, out Handler); if (Handler != null) { Handler.Dispose(); } }
/// <summary> /// 添加处理程序 /// </summary> /// <param name="Config"></param> private void AddQueue(MQConfig.MQQueueConfig Config, MQServerConfig Server) { if (Config == null || Server == null) { return; } if (!DicQueue.ContainsKey(Config.QueueName)) { ReceivedQueueHandler handler = new ReceivedQueueHandler(Config, Server); DicQueue.TryAdd(Config.QueueName, handler); } }