internal void RegisterJob <TJobIn, TJobOut>(IPipelineJob <TJobIn, TJobOut> job)
        {
            if (job == null)
            {
                throw new ArgumentNullException("job");
            }

            _jobs.Add(job);
        }
Exemplo n.º 2
0
        public JobElement(IPipelineJob job, int element, T initData, DataProperty[] properties)
        {
            Job = job;
            Nr  = element;

            CurrentStepName = "init";

            if (properties != null)
            {
                foreach (var property in properties)
                {
                    Properties.Add(property.Name, property.Value);
                }
            }

            Data = initData;
        }
Exemplo n.º 3
0
        private void ExecuteStage(IQueue <Object> input, IPipelineJob job)
        {
            var jobType = job.GetType();

            try
            {
                foreach (var item in input.GetElements())
                {
                    //if (token.IsCancellationRequested) break;
                    job.InternalPerform(item);
                }
            }
            catch (OperationCanceledException) { }
            finally
            {
                job.Output.CompleteAdding();
            }
        }
Exemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <typeparam name="TJobIn"></typeparam>
        /// <typeparam name="TJobOut"></typeparam>
        /// <param name="job"></param>
        /// <returns></returns>
        public PipelineBuilder <TIn, TOut> Register <TJobIn, TJobOut>(IPipelineJob <TJobIn, TJobOut> job)
        {
            if (job == null)
            {
                throw new NullReferenceException("Null reference pipeline job instance.");
            }

            //Input type must match with first input job
            if (_pipeline.Count == 0 && typeof(TJobIn) != typeof(TIn))
            {
                throw new Exception("Input of job is not the same of declared pipeline.");
            }

            //Pipeline output type must match with current job input
            if (_pipeline.Count > 0 && _pipeline.OutputType != typeof(TJobIn))
            {
                throw new Exception("Input of current job don´t match with previous job output.");
            }

            _pipeline.RegisterJob(job);

            return(this);
        }
Exemplo n.º 5
0
 public Stage(IPipelineJob job)
 {
     Job = job;
 }
Exemplo n.º 6
0
 public static void Log(IPipelineJob item, string action)
 {
     Log(item.Elements(), action);
 }