Three ways to know existence of an akka actor

前端 未结 1 1718
借酒劲吻你
借酒劲吻你 2020-12-30 09:27

I am working on akka actors(JAVA) and recently came to know that there are 3 ways(may be more) to know existing of an actor.

  1. Sending a Identify mess

相关标签:
1条回答
  • 2020-12-30 09:37

    Well, there is only one way to know whether an Actor existed at a certain point in the past: if you receive a message from it. All of the above are just variations on this theme.

    That said, once you have the ActorRef, you can use DeathWatch to be notified about that actor’s termination. But not yet having received the Terminated message does not mean that the actor is still alive: the Terminated might already be on its way.

    Think of Actors as people who can only communicate by sending email. That analogy works quite well for the semantics of their interaction.

    0 讨论(0)
提交回复
热议问题