public int handler5(statemsg msg) { return state; }
public void SimpleTestRestartActor() { var acts = new ActorSystem(); var act = acts.CreateActor<SimpleTestActor>(); var m = new statemsg() { newstate = 10 }; var tsk = act.Ask<int>(m); tsk.Wait(); m = new statemsg() { newstate = 10 }; tsk = act.Ask<int>(m); tsk.Wait(); Assert.AreEqual(10, tsk.Result); acts.RestartActor(act); m = new statemsg() { newstate = 10 }; tsk = act.Ask<int>(m); tsk.Wait(); Assert.AreEqual(0, tsk.Result); Console.WriteLine("test complete"); }
public int handler3(statemsg msg) { int t = state; state = msg.newstate; return t; }