Akka: Cleanup of dynamically created actors necessary when they have finished?

后端 未结 4 1954
甜味超标
甜味超标 2021-02-07 01:33

I have implemented an Actor system using Akka and its Java API UntypedActor. In it, one actor (type A) starts other actors (type B) dynamically on demand, using getContext

4条回答
  •  忘掉有多难
    2021-02-07 02:26

    Actors by default do not consume much memory. If the application intends to use actor b later on, you can keep them alive. If not, you can shut them down via poisonpill. As long your actors are not holding resources, leaving an actor should be fine.

提交回复
热议问题