Akka.Tests.Actor.DeathWatchSpec.KnobActor.Receive C# (CSharp) Method

Receive() protected method

protected Receive ( object message ) : bool
message object
return bool
            protected override bool Receive(object message)
            {
                message.Match().With<string>(x =>
                {
                    if (x == Knob)
                    {
                        var kid = Context.ActorOf(Props.Create(() => new KnobKidActor()), "kid");
                        Context.Watch(kid);
                        kid.Forward(Knob);
                        Context.Become(msg =>
                        {
                            msg.Match().With<Terminated>(y =>
                            {
                                if (y.ActorRef == kid)
                                {
                                    _testActor.Tell(Bonk);
                                    Context.UnbecomeStacked();
                                }
                            });
                            return true;
                        });
                    }
                });
                return true;
            }
        }
DeathWatchSpec.KnobActor