Akka自动驾驶仪是否响应已发送的消息

时间:2019-04-11 20:32:05

标签: java akka

使用Akka mmodel = MultiModel(solver = CplexSolver("CPLEX.tilim"=100), linear = true) 时,它将处理已经发送到测试探针的消息吗?

特别是我希望该代码通过吗?

AutoPilot

它似乎无法写入,但是如果我在发送消息之前将new JavaTestKitDsl(...) {{ TestProbe probe = new TestProbe(...); probe.testActor().tell("Hello", getRef()); // Be certain that the message has been queued Thread.sleep(1000); probe.setAutoPilot(new TestActor.AutoPilot() { public TestActor.AutoPilot run(ActorRef sender, Object msg) { sender.tell(msg, null); return noAutoPilot(); } }); expectMsg("Hello"); }}; 移至该位置,则会通过。

在实际系统中,测试要复杂得多,而且到了三个参与者大致同时向探测器发送不同消息的地步。我原本打算在此时设置自动驾驶仪,以便很清楚地知道消息将到达的位置,但是看来我需要在发送触发其他参与者的消息之前设置自动驾驶仪。

documentation对此一无所知。

如果这很重要,它将与Akka 2.5.18和Java 10一起运行。

0 个答案:

没有答案
相关问题