Пример #1
0
        public JsWorkerDocumentation GetJsWorker(string workerName, JsExecutionContext executionContext)
        {
            if (!JsWorkers.ContainsKey(workerName))
            {
                var mes = string.Format(ExceptionTexts.NoWorkerWithNameRegisteredFormat, workerName);
                executionContext.ExecutionLogs.Add(new JsExecutionLog
                {
                    EventIdName = EventIds.JsExecutorComponents.GetJsWorkerNotFound,
                    Message = mes,
                });
                throw new InvalidOperationException(mes);
            }

            executionContext.ExecutionLogs.Add(new JsExecutionLog
            {
                EventIdName = EventIds.JsExecutorComponents.GetJsWorkerFound,
                Message = $"Js рабочий найден по указанному названию '{workerName}'",
            });

            return JsWorkers[workerName];
        }
Пример #2
0
 public List <IJsWorker> EnumerateWorkers() => JsWorkers.Select(x => x(AmbientContext)).ToList();