Skip to content

State in Supervisor.which_children #4

@h4cc

Description

@h4cc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions