Exemplo n.º 1
0
        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);
                }
            }
        }
Exemplo n.º 2
0
 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.");
 }