Beispiel #1
0
        private void CheckExecutorConfigDuplicate(ParallelCommandExecutorConfig config)
        {
            var existsExecutorConfigs = _executorConfigs.Select(e => e.Name);

            if (existsExecutorConfigs.Contains(config.Name))
            {
                throw new DupilicateExecutorException();
            }
        }
Beispiel #2
0
        public IParallelCommandExecutorContainer RegisterExecutor <TExecutor>()
            where TExecutor : class, IParallelCommandExecutor
        {
            var executor       = _httpContextAccessor.HttpContext.RequestServices.GetService <TExecutor>();
            var executorConfig = new ParallelCommandExecutorConfig(executor);

            CheckExecutorConfigDuplicate(executorConfig);
            _executorConfigs.Add(executorConfig);
            return(this);
        }