async Task RenderNow(ICommunicationContext context, PipelineStage stage) { PipelineLog.WriteDebug("Pipeline is in RenderNow mode."); if (!stage.ResumeFrom <KnownStages.IOperationResultInvocation>()) { if (stage.OwnerStage != null) { PipelineLog.WriteError("Trying to launch nested pipeline to render error failed."); AttemptCatastrophicErrorNotification(context); return; } using ( PipelineLog.Operation(this, "Rendering contributor has already been executed. Calling a nested pipeline to render the error.")) { var nestedPipeline = new PipelineStage(this, stage); if (!nestedPipeline.ResumeFrom <KnownStages.IOperationResultInvocation>()) { throw new InvalidOperationException("Could not find an IOperationResultInvocation in the new pipeline."); } await RunCallGraph(context, nestedPipeline); } } }
public void Initialize() { if (IsInitialized) { return; } using (PipelineLog.Operation(this, "Initializing the pipeline.")) { foreach (var item in _resolver.ResolveAll <IPipelineContributor>()) { PipelineLog.WriteDebug("Initialized contributor {0}.", item.GetType().Name); _contributors.Add(item); } _callGraph = GenerateCallGraph(); } IsInitialized = true; PipelineLog.WriteInfo("Pipeline has been successfully initialized."); }