예제 #1
0
        private ITaskEngine CreateTaskEngine(int workerCount)
        {
            ITaskEngine engine = new StandardTaskEngine(GetTaskEngineOptions(workerCount),
                                                        mProducerAndResultOptions,
                                                        mTaskQueueConsumerOptions,
                                                        CreateTaskExecutorRegistry(),
                                                        CreateExecutionPeformanceMonitorWriter(),
                                                        mTimestampProvider);

            engine.ScanAssemblies(GetType().Assembly);
            return(engine);
        }
        public ITaskEngine BuildTaskEngine(TaskQueueConsumerOptions consumerOptions,
                                           TaskQueueOptions producerAndResultOptions,
                                           ITaskExecutorRegistry executorRegistry,
                                           IExecutionPerformanceMonitorWriter executionPerfMonWriter,
                                           ITimestampProvider timestampProvider)
        {
            if (consumerOptions == null)
            {
                throw new ArgumentNullException(nameof(consumerOptions));
            }

            if (producerAndResultOptions == null)
            {
                throw new ArgumentNullException(nameof(producerAndResultOptions));
            }

            if (executorRegistry == null)
            {
                throw new ArgumentNullException(nameof(executorRegistry));
            }

            if (executionPerfMonWriter == null)
            {
                throw new ArgumentNullException(nameof(executionPerfMonWriter));
            }

            StandardTaskEngine taskEngine = new StandardTaskEngine(BuildOptions(),
                                                                   producerAndResultOptions,
                                                                   consumerOptions,
                                                                   executorRegistry,
                                                                   executionPerfMonWriter,
                                                                   timestampProvider);

            taskEngine.ScanAssemblies(mExecutorAssemblies);
            return(taskEngine);
        }