delayed_otp
delayed_otp copied to clipboard
State in Supervisor.which_children
When calling a which_children with a child that is currently delayed, the result for child does not match the Supervisor behaviour because next to a pid, :restarting and :unknown the value nil can be returned.
See: https://hexdocs.pm/elixir/Supervisor.html#which_children/1
This function in DelayedServer will return nil:
def handle_call(:delayed_pid, _from, state), do: {:reply,state.pid,state}
I think this function should not return nil, but rather :restarting or maybe a new value like :delayed.