コード例 #1
0
ファイル: JobRunner.cs プロジェクト: liemqv/EventFlow
        public Task ExecuteAsync(string jobName, int version, string json, CancellationToken cancellationToken)
        {
            JobDefinition jobDefinition;

            if (!_jobDefinitionService.TryGetJobDefinition(jobName, version, out jobDefinition))
            {
                throw UnknownJobException.With(jobName, version);
            }

            var executeCommandJob = (IJob)_jsonSerializer.Deserialize(json, jobDefinition.Type);

            return(executeCommandJob.ExecuteAsync(_resolver, cancellationToken));
        }