[erlang-questions] Question about behaviours in Erlang/OTP

Robert Raschke rtrlists@REDACTED
Mon Jul 14 08:31:04 CEST 2014


Hi Yves,

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
external.

Robby
 On Jul 14, 2014 12:59 AM, "Yves S. Garret" <yoursurrogategod@REDACTED>
wrote:

> Hello,
>
> 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
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140714/2cec83d3/attachment.htm>


More information about the erlang-questions mailing list