[erlang-questions] terminate supervisor from it's child process
Thu Feb 14 06:17:09 CET 2019
I'm writing udp server with supervision tree like below.
server_sup - udp_sup - |- udp_worker
1. app opening UDP socket
2. server_sup spawn udp_sup process tree with that udp socket
3. udp_worker receives every packet from socket
4. udp_woker passing packet to other worker based on first byte
when timeout in udp_worker happen,
I wanna terminate all processes in udp_sup (including udp_sup)
so I tried shutdown udp_sup with calling `server_sup:terminate_child(pid)`
that's terminates but rises SUPERVISOR REPORT with shutdown_error.
I also tried one_for_all for udp_sup's childspec but I don't want to
restart children because UDP socket already timeouted.
is there any way to terminate supervisor from it's child process ?
or any other recommended process architecture for UDP server ?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions