In AKKA does calling shutdown on a supervisor stop all the actors it's supervising?
Asked Answered
W

1

8

Let's say I have a supervisor that has linked 2 actors. When my app shutsdown I want to shutdown those actors gracefully. Does calling supervisor.shutdown() stop all the actors or do I still need to stop my actors manually?

gracias

Witless answered 18/2, 2011 at 20:16 Comment(0)
H
8

Stopping a supervisor (calling Supervisor.stop()) stops all linked (supervised) actors:

final class SupervisorActor{
...
   override def postStop(): Unit = shutdownLinkedActors

However, when you want to shutdown all actors in the system gracefully, there's another proper way to do that, using Actor Registry (that holds information about all the actors systemwide):

Actor.registry.shutdownAll
Hush answered 18/2, 2011 at 20:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.