# `Parent.Client`
[🔗](https://github.com/sasa1977/parent/blob/0.13.0/lib/parent/client.ex#L1)

Functions for interacting with parent's children from other processes.

All of these functions 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 `c: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.

# `child_meta`

```elixir
@spec child_meta(GenServer.server(), Parent.child_ref()) ::
  {:ok, Parent.child_meta()} | :error
```

Client interface to `Parent.child_meta/1`.

If the parent is a registry, the result will be obtained from the ETS table.

# `child_pid`

```elixir
@spec child_pid(GenServer.server(), Parent.child_id()) :: {:ok, pid()} | :error
```

Client interface to `Parent.child_pid/1`.

If the parent is a registry, the result will be obtained from the ETS table.

# `children`

```elixir
@spec children(GenServer.server()) :: [Parent.child()]
```

Client interface to `Parent.children/0`.

If the parent is a registry, the result will be obtained from the ETS table.

# `restart_child`

```elixir
@spec restart_child(GenServer.server(), Parent.child_ref()) :: :ok | :error
```

Client interface to `Parent.restart_child/1`.

# `return_children`

```elixir
@spec return_children(GenServer.server(), Parent.stopped_children()) :: :ok
```

Client interface to `Parent.return_children/1`.

# `shutdown_all`

```elixir
@spec shutdown_all(GenServer.server(), any()) :: Parent.stopped_children()
```

Client interface to `Parent.shutdown_all/1`.

# `shutdown_child`

```elixir
@spec shutdown_child(GenServer.server(), Parent.child_ref()) ::
  {:ok, Parent.stopped_children()} | :error
```

Client interface to `Parent.shutdown_child/1`.

# `start_child`

```elixir
@spec start_child(GenServer.server(), Parent.start_spec(), Keyword.t()) ::
  Parent.on_start_child()
```

Client interface to `Parent.start_child/2`.

# `update_child_meta`

```elixir
@spec update_child_meta(
  GenServer.server(),
  Parent.child_id(),
  (Parent.child_meta() -&gt; Parent.child_meta())
) :: :ok | :error
```

Client interface to `Parent.update_child_meta/2`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
