parent v0.11.0-rc.1 Parent.Client View Source
Functions for interacting with parent's children from other processes.
All of these functions by default issue a call to the parent process. Therefore, they can't be
used from inside the parent process. Use functions from the Parent
module instead to interact
with the children from within the process.
Likewise these functions can't be invoked inside the child process during its initialization.
Defer interacting with the parent to GenServer.handle_continue/2
, or if you're using another
behaviour which doesn't support such callback, send yourself a message to safely do the post-init
interaction with the parent.
If parent is configured with the registry?: true
option, some query functions, such as
child_pid/2
will perform an ETS lookup instead of issuing a call, so the caveats above won't
apply.
Link to this section Summary
Link to this section Functions
child_meta(parent, child_ref)
View Sourcechild_meta(GenServer.server(), Parent.child_ref()) :: {:ok, Parent.child_meta()} | :error
child_pid(parent, child_id)
View Sourcechild_pid(GenServer.server(), Parent.child_id()) :: {:ok, pid()} | :error
restart_child(parent, child_ref)
View Sourcerestart_child(GenServer.server(), Parent.child_ref()) :: :ok | :error
return_children(parent, stopped_children)
View Sourcereturn_children(GenServer.server(), Parent.stopped_children()) :: :ok
shutdown_all(server)
View Sourceshutdown_all(GenServer.server()) :: Parent.stopped_children()
shutdown_child(parent, child_ref)
View Sourceshutdown_child(GenServer.server(), Parent.child_ref()) :: {:ok, Parent.stopped_children()} | :error
start_child(parent, child_spec)
View Sourcestart_child(GenServer.server(), Parent.start_spec()) :: Parent.on_start_child()
update_child_meta(parent, child_ref, updater)
View Sourceupdate_child_meta( GenServer.server(), Parent.child_id(), (Parent.child_meta() -> Parent.child_meta()) ) :: :ok | :error