Example #1
0
        /// <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);
        }
Example #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="threadProvider"></param>
 public MessageQueue(IThreadPoolProvider threadProvider)
     : this(false, threadProvider)
 {
 }
Example #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="haschecktimer"></param>
 /// <param name="threadProvider"></param>
 public MessageQueueDoublePriority(bool haschecktimer, IThreadPoolProvider threadProvider)
 {
     this._threadProvider = threadProvider ?? ThreadPoolProviderManager.Instance;
 }
Example #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="threadProvider"></param>
 public MessageQueueDoublePriority(IThreadPoolProvider threadProvider)
     : this(false, threadProvider)
 {
 }