Пример #1
0
            public PortTestSetup(ActorSystem system) : base(system)
            {
                Out = new UpstreamPortProbe <int>(this);
                In  = new DownstreamPortProbe <int>(this);

                ManualInit(_assembly);
                Interpreter.AttachDownstreamBoundary(0, In);
                Interpreter.AttachUpstreamBoundary(0, Out);
                Interpreter.Init(null);
            }
Пример #2
0
            public FailingStageSetup(ActorSystem system, bool initFailOnNextEvent = false) : base(system)
            {
                Upstream   = new UpstreamPortProbe <int>(this);
                Downstream = new DownstreamPortProbe <int>(this);

                _failOnNextEvent = initFailOnNextEvent;
                _failOnPostStop  = false;

                _stageIn    = new Inlet <int>("sandwitch.in");
                _stageOut   = new Outlet <int>("sandwitch.out");
                _stageShape = new FlowShape <int, int>(_stageIn, _stageOut);

                Stage = new Lazy <GraphStageLogic>(() => new FailingGraphStageLogic(this, _stageShape));

                GraphStage <FlowShape <int, int> > sandwitchStage = new SandwitchStage(this);

                Builder(sandwitchStage)
                .Connect(Upstream, _stageIn)
                .Connect(_stageOut, Downstream)
                .Init();
            }