When using the :simple_one_for_one strategy, we specify the children to launch dynamically:
supervise([worker(FooServer, [])], strategy: :simple_one_for_one)
We then use something like the following to start children:
def start_child(arg1, arg2) do
Supervisor.start_child(__MODULE__, [arg1, arg2])
end
The documentation states (emphasis mine):
In the case of :simple_one_for_one, the child specification defined in the supervisor will be used and instead of a child_spec, an arbitrary list of terms is expected. The child process will then be started by appending the given list to the existing function arguments in the child specification.
I tried the following
supervise([worker(FooServer, [:foo])], strategy: :simple_one_for_one)
# ^^^^
# "fixed" argument
But it seems arguments aren't appended, and I can't find how to access these fixed arguments. Is it even possible to do this?