[erlang-questions] Reusing servers in a new supervision tree
Erik Søe Sørensen
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
> 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
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions