[erlang-questions] Reusing servers in a new supervision tree

Erik Søe Sørensen eriksoe@REDACTED
Fri Apr 11 00:28:15 CEST 2014

Do you need a supervision tree at all - or could you start the servers
What kind of test is it - unit tests or some larger test?
You could let the _sup module (or for that matter _app) choose a different
structure based on whether the system's in testing mode,  and/or you could
"-ifdef" the behavior to be different (this could pay well with e.g. eunit,
which defines TEST).
I've built systems where the set of server processes in an application vary
depending on what parts are configured in the .config file.  That's fairly
easy to do in _sup/_app.
Den 10/04/2014 16.12 skrev "David Welton" <davidnwelton@REDACTED>:

> > On another hand if you have processes A, B, C, D, E and F but B, D and F
> form a functional subsystem.
> > Would it make sense to run them behind own supervisor? Thus, you can
> configure run time to switch on / off subsystem by starting stopping
> supervisors.
> Well, in the "testing" mode, the supervision tree really isn't as
> important as in production mode - we just need all the executables
> that are behind the erlang services up and running.  So far it looks
> like using terminate_child to swap modes is the easiest thing... I
> just wanted to check and see if the idea was not completely abhorrent
> to right minded Erlang programmers.
> Thank you
> --
> David N. Welton
> http://www.welton.it/davidw/
> http://www.dedasys.com/
> _______________________________________________
> 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/20140411/41e100b3/attachment.htm>

More information about the erlang-questions mailing list