How can I send event from my ActorRef to all created children with akka fsm?

144 views Asked by At

I'm using AKKA fsm with java. I'm trying to send message to all the children ever created by my actorRef. Lets say for event X my actorRef create new FSM, but didn't save it in a struct. and for event Y I would like to send this event to all my "sons" (which created before by me, but didn't saved). Does someone have an idea how can I access to all my child? and "tell" them the event?

1

There are 1 answers

0
Josep Prat On

You can get an Iterable with all children of the current actor by calling children on the ActorContext. This should be enough for your use case.

http://doc.akka.io/japi/akka/current/akka/actor/ActorContext.html#children--