Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

242
Visualizações
How to listen to messages which are sent to ActorSystem (Akka 2.0)

I have a code, where I create an Actor from AkkaSystem.

return system.actorOf(Props.apply(new Creator<Actor>()
....

Inside the child actor I call

context().parent().tell(new DeathByError());
context().stop(self());

is there a way to know from the parent (ActorSystem object) to know that child sent DeathByError message ?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

When you are handling the message you can call getSender() which should return the ActorRef of the one who sent the message.

over 4 years ago · Santiago Trujillo Relatório

0

If you meant "what" child sent the message, Micheal Rose's answer is correct.

If you simply want to receive it, add a handler for it in the parents receive method.

Note that if you "watch" an actor from another actor, the latter is notified when the former dies, without need for you to explicitly sending a message ( http://doc.akka.io/docs/akka/current/scala/actors.html#Actor_Lifecycle )

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda