Tell a supervisor to stop when all children are gone

13 views
Skip to first unread message

Frank Muller

unread,
Mar 23, 2022, 3:50:25 AM3/23/22
to Erlang-Questions Questions
Hi guys,

How should I configure my supervisor to automatically stop it when its children are stopped?

I’m using rest_for_one strategy.

Thanks.
/Frank

Roger Lipscombe

unread,
Mar 23, 2022, 4:16:39 AM3/23/22
to Frank Muller, Erlang-Questions Questions
Use 'auto_shutdown' and mark all of the children as 'significant'; see
https://www.erlang.org/doc/man/supervisor.html#significant_child.
Requires OTP-24.something, iirc.

Frank Muller

unread,
Mar 23, 2022, 4:59:07 AM3/23/22
to Roger Lipscombe, Zsolt Laky, Erlang-Questions Questions
Exactly what I was looking for. Thank you. 


Hi Frank,

Would auto_shutdown set to all_significant help?


Br,
Zsolt

Sent from my iPad

On 2022. Mar 23., at 8:50, Frank Muller <frank.mu...@gmail.com> wrote:

Hi guys,
Reply all
Reply to author
Forward
0 new messages