Closed emtenet closed 4 years ago
Yes registering the top level supervisor makes it simpler to introspect the application from the shell.
You say you have an _app
module but not a top-level supervisor? Could you clarify?
Thanks for the quick dose of perspective Loïc.
Whilst simplifying an old app I reduced the supervision tree down to a single gen_server. My problem was that I went to far and removed the top level supervisor leaving a supervisor tree with no supervisors! Hence my confusion why erlang.mk was insisting on a registered supervisor in addition to my lone registered gen_server.
Sorry to take up your time, I will close this issue. Thanks, Michael.
No worries. :-)
When an app file is created from PROJECT_XXX variables and the PROJECT_MOD module exists, the registered key always includes $(PROJECT)_sup regardless of whether a $(PROJECT)_sup source file exists, or if it gets registered.
Defining the PROJECT_REGISTERED variable only adds names to the registered list, the $(PROJECT)_sup item cannot be removed.
Is there a best practice to register an application's top level supervisor that I am not aware of? I notice cowboy and ranch both register their top level supervisor, but only ranch references that registered name.