[erlang-questions] Question about behaviours in Erlang/OTP
Mon Jul 14 08:31:04 CEST 2014
one classic scenario where you have a gen_server that needs to trap exits
is a server that wraps around a port program.
If your server starts an external program that it makes available as
resource to Erlang, then it will want to know about crashes explicitly,
since normal supervision cannot easily deal with restarting something
On Jul 14, 2014 12:59 AM, "Yves S. Garret" <yoursurrogategod@REDACTED>
> I'm looking at some code that was written where a user uses a behaviour of
> gen_server and then uses a process_flag(trap_exit, true). To me, this
> seems like a supervisor behaviour would work better.
> What would be a better approach in this case? To declare this module a
> supervisor? Is it possible (sensible? logical?) to give the same module
> gen_server and supervisor behaviours?
> Thanks in advance!
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions