/// <summary> /// 实例化对象 /// </summary> public MessageQueueMultiple(int maxRunThreadCount, EventHandle <IMessageQueue <T>, MessageEventArgs <T> > call , IThreadPoolProvider provider) { if (provider == null) { provider = ThreadPoolProviderManager.Instance; } this._provider = provider; if (call != null) { MessageComing = call; } else { MessageComing = (S, E) => { }; } _semaphore = new Semaphore(maxRunThreadCount, maxRunThreadCount); }
/// <summary> /// /// </summary> /// <param name="threadProvider"></param> public MessageQueue(IThreadPoolProvider threadProvider) : this(false, threadProvider) { }
/// <summary> /// /// </summary> /// <param name="haschecktimer"></param> /// <param name="threadProvider"></param> public MessageQueueDoublePriority(bool haschecktimer, IThreadPoolProvider threadProvider) { this._threadProvider = threadProvider ?? ThreadPoolProviderManager.Instance; }
/// <summary> /// /// </summary> /// <param name="threadProvider"></param> public MessageQueueDoublePriority(IThreadPoolProvider threadProvider) : this(false, threadProvider) { }