[erlang-questions] start/stop applications without a callback module

Xavier Noria fxn@REDACTED
Tue Jan 2 12:39:12 CET 2018


The rewording I have in mind would be to sharply distinguish
starting/stopping *applications* from starting/stopping their supervision
tree if there is any, and from callback invocation. Also, to make more
explicit the existence of library and regular/active applications.

For example, define that starting an application means (needs review):

1. (Guessing) The application controller makes sure all applications
specified in the application resource file are started.
2. The application controller spawns an application master process for the
application.
3. The application master becomes the group leader of all the application
processes.
4. (Regular applications only) The application master calls `start/2` in
the callback module if there is one, and stores the returned PID for later
use.

(Don't know if firing SASL events is worth being documented, I see
generally they don't seem to be.)

In particular, you know who the group leader is when `start/2` runs. And it
is obvious that there are things going on regardless of the existence of a
callback module.

Stopping an application means (needs review):

1. (Regular applications only) The application master shuts down the top
supervisor using the PID stored when the application started.
2. (Regular applications only) The application master invokes the `stop/1`
callback of the application callback module.
3. The application master process is shut down (by the application
controller?).
4. <<Termination logic depending on the application type goes here>>

It could also be explicitly said that unless stated otherwise, from then on
an "application" means a "regular application".

Are there factual errors? Makes sense?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180102/5dea4cec/attachment.htm>


More information about the erlang-questions mailing list