Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

236
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!