internal void RegisterJob <TJobIn, TJobOut>(IPipelineJob <TJobIn, TJobOut> job) { if (job == null) { throw new ArgumentNullException("job"); } _jobs.Add(job); }
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; }
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(); } }
/// <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); }
public Stage(IPipelineJob job) { Job = job; }
public static void Log(IPipelineJob item, string action) { Log(item.Elements(), action); }