如果我打电话
actorRef.tell("MSG", null);
Run Code Online (Sandbox Code Playgroud)
来自非演员
它仍然是线程安全的吗?和async立即完成?
消息是不可变的.
基本上我的代码是:
class NonActor {
....
public void tellTest() {
actorRef.tell("MSG", null);
}
}
Run Code Online (Sandbox Code Playgroud)
基本上actorRef.tell("MSG", null);创造了一个像
(actorRef, Envelope(msg, sender))
Run Code Online (Sandbox Code Playgroud)
并将其放入ActorSystem消息队列中.因此tell,不以任何方式与演员联系.该tell方法本身无疑是线程安全的.