Closed josevalim closed 8 years ago
If we are going to use data types should we switch to the format used by :supervisor
from OTP 18+ that uses maps?
@fishcakez returning a map for optional keys is very foreign in Elixir, as well as the {:ok, {opts, children}}
format. Plus OTP uses different defaults than Elixir, which means we would have different behaviour anyway.
If we use our own data format wont we lose the ability to appup top level supervisors?
To add context to my above comment. The module of the top level supervisor is discovered using format_status/2
. This is controlled by :supervisor
. To use our own data structures we would have to wrap use modules and that would mean :supervisor
would always point to the wrapper module. Therefore preventing discovery of the top level supervisor's module and so it could not be reconfigured as part of an appup.
We can't do this one. So I will open up an issue to merge DynamicSupervisor and we will need to revisit the DynamicSupervisor init return by then.
The goal is to return those options as part of the
:ok
tuple. Instead of:we should return:
The rationale is to use regular data types and avoid centralizing all options in the
supervise
definition. This is particularly important when we include the DynamicSupervisor, which will have options specific only to itself.The tuple format is already being used by GenStage as well as the DynamicSupervisor.
/cc @fishcakez