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