1
votes

I am having hard time in figuring out how do I know when my actor is finished from non actor code.

Trying to use akka actors for concurrent execution and it seems to be really good with that, but I need to know when all of them are done.

I have added a supervisor actor that spawns of actors to do work, from the supervisor/parent actor, I can watch for the Terminated messages of children.

I need help on figuring out whether my supervising actor is done or not, from regular java code that is outside akka actor system.

Is this possible, please provide pointers.

Thanks Hari

1

1 Answers

1
votes

Given that you interact with actors only via messages, you should ask the supervisor for its state. Using the ask-pattern, you can send a message A to the actor and the method return a Future with the response. On the actor-side you have to handle the message A, replying to the sender with the actual status.