/// <summary> /// Gets the minimal pipeline graph where all the specified stages are included. /// </summary> /// <param name="stages">The stages.</param> /// <returns>The pipeline graph. In case of errors, this might be invalid.</returns> public static PipelineGraph GetPipelineGraphIncludingStages(IEnumerable <IPipelineStage> stages) { var graph = new PipelineGraph(); var propagation = new PipelinePropagation(stages, Dependencies); lock (Dependencies) propagation.BuildPropagationTopology(stages, 0); foreach (var s in propagation.CurrentPropagationTopology !) { graph.AddNode(s.Stage); foreach (var dep in s.Dependent) { graph.AddEdge(s.Stage, dep); } } return(graph); }
private static void InvalidatePipeline(IEnumerable <IPipelineStage> stages) { var propagation = new PipelinePropagation(stages, Dependencies); lock (Dependencies) { propagation.BuildPropagationTopology(stages, PipelineVersion); propagation.CheckForConcurrentPropagation(PotentialStagesForUpdate); } try { propagation.Propagate(stages); } finally { lock (Dependencies) { PotentialStagesForUpdate.ExceptWith(propagation.StagesThisPropagation); IncrementOperation(); } } }