Ejemplo n.º 1
0
 public LifecycleLogic(LifecycleStage stage, IActorRef testActor) : base(stage.Shape)
 {
     _testActor = testActor;
     SetHandler(stage._in, EagerTerminateInput);
     SetHandler(stage._out, () =>
     {
         CompleteStage();
         testActor.Tell("pulled");
     });
 }
Ejemplo n.º 2
0
        public void A_GraphStageLogic_must_invoke_livecycle_hooks_in_the_right_order()
        {
            this.AssertAllStagesStopped(() =>
            {
                var g = new LifecycleStage(TestActor);

                Source.Single(1).Via(g).RunWith(Sink.Ignore <int>(), Materializer);
                ExpectMsg("preStart");
                ExpectMsg("pulled");
                ExpectMsg("postStop");
            }, Materializer);
        }