protected virtual JobsContext GetJobsContext() { var context = new JobsContext(); SetContextParams(context); return(context); }
public Job(JobsContext jobsContext, params Job[] parents) { this.jobsContext = jobsContext; this.parents = parents; foreach (var parent in parents) { parent.AddChild(this); } }
protected virtual void SetContextParams(JobsContext context) { if (settings.MaxActionsInParallel > 1) { context.ActionSemaphore = new SemaphoreSlim(settings.MaxActionsInParallel, settings.MaxActionsInParallel); context.UseActionSemaphore = true; } if (settings.MaxBackwardActionsInParallel > 1) { context.BackActionSemaphore = new SemaphoreSlim(settings.MaxBackwardActionsInParallel, settings.MaxBackwardActionsInParallel); context.UseBackActionSemaphore = true; } }