Akka.Streams.Implementation.Fusing.GraphInterpreter.Init C# (CSharp) Method

Init() public method

Initializes the states of all the stage logics by calling GraphStageLogic.PreStart. The passed-in materializer is intended to be a SubFusingMaterializer that avoids creating new Actors when stages materialize sub-flows.If no such materializer is available, passing in null will reuse the normal materializer for the GraphInterpreter—fusing is only an optimization.
public Init ( IMaterializer subMaterializer ) : void
subMaterializer IMaterializer
return void
        public void Init(IMaterializer subMaterializer)
        {
            SubFusingMaterializer = subMaterializer ?? Materializer;
            for (var i = 0; i < Logics.Length; i++)
            {
                var logic = Logics[i];
                logic.StageId = i;
                logic.Interpreter = this;
                try
                {
                    logic.BeforePreStart();
                    logic.PreStart();
                }
                catch (Exception e)
                {
                    if (Log.IsErrorEnabled)
                        Log.Error(e, $"Error during PreStart in [{Assembly.Stages[logic.StageId]}]");
                    logic.FailStage(e);
                }
                AfterStageHasRun(logic);
            }
        }