示例#1
0
 public ExecutorThreadPoolManager(IExecutorService executorService, ThreadPoolType poolType, int threads,
                                  int capacity, ExecutorProcessItemHandler <T> handler)
     : base(executorService)
 {
     _handler               = handler;
     _executor              = ThreadPoolExecutorFactory.CreateThreadPool <T>(executorService, poolType, threads, -1);
     _executor.ProcessItem += OnExecutor_ProcessItem;
 }
示例#2
0
 public MessageQueueManager(IExecutorService executorService, ThreadPoolType poolType,
                            MessageQueueWorkerInfo[] workerInfos,
                            KeyValuePair <string, CreateQueueMessageWrapperHandler>[] createMessageWrappers)
     : base(executorService)
 {
     Debug.Assert(workerInfos != null);
     _poolType = poolType;
     this.Initialize(workerInfos, createMessageWrappers);
 }
示例#3
0
 internal MessageQueueWorker(MessageQueueManager parent, IExecutorService executorService,
                             ThreadPoolType poolType, MessageQueueWorkerInfo workerInfo,
                             KeyValuePair <string, CreateQueueMessageWrapperHandler>[] createMessageWrappers)
     : base(executorService)
 {
     Debug.Assert(workerInfo.QueueInfos.Count != 0);
     _parent                   = parent;
     _poolType                 = poolType;
     this.MessageThreshold     = workerInfo.MessageThreshold;
     this.QueueThreshold       = workerInfo.QueueThreshold;
     this.MQUseWorkerThread    = workerInfo.MQUseWorkerThread;
     this.MQCheckMessageResult = workerInfo.MQCheckMessageResult;
     this.Initialize(workerInfo, createMessageWrappers);
 }
 public static IThreadPoolExecutor <T> CreateThreadPool <T>(IExecutorService executorService, ThreadPoolType poolType, int threadCount,
                                                            int threadQueueCount, bool kernelModeQueue, bool flushItemsBeforeClose)
     where T : IExecutorKey
 {
     return(CreateThreadPool <T>(new ThreadPoolExecutorArg()
     {
         ExecutorService = executorService,
         PoolType = poolType,
         ThreadCount = threadCount,
         ThreadQueueCount = threadQueueCount,
         KernelModeQueue = kernelModeQueue,
         FlushItemsBeforeClose = flushItemsBeforeClose,
     }));
 }
 public static IThreadPoolExecutor <T> CreateThreadPool <T>(IExecutorService executorService, ThreadPoolType poolType, int threadCount, int threadQueueCount)
     where T : IExecutorKey
 {
     return(CreateThreadPool <T>(executorService, poolType, threadCount, threadQueueCount, false, false));
 }
 public MessageQueueManager(IExecutorService executorService, ThreadPoolType poolType,
     MessageQueueWorkerInfo[] workerInfos,
     KeyValuePair<string, CreateQueueMessageWrapperHandler>[] createMessageWrappers)
     : base(executorService)
 {
     Debug.Assert(workerInfos != null);
     _poolType = poolType;
     this.Initialize(workerInfos, createMessageWrappers);
 }