Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/elixir/lib/gen_server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,16 @@ defmodule GenServer do
The generated `child_spec/1` can be customized with the following options:

* `:id` - the child specification identifier, defaults to the current module
* `:restart` - when the child should be restarted, defaults to `:permanent`
* `:shutdown` - how to shut down the child, either immediately or by giving it time to shut down
* [`:restart`](`m:Supervisor#module-restart-values-restart`) - when the
child should be restarted, defaults to `:permanent`
* [`:shutdown`](`m:Supervisor#module-shutdown-values-shutdown`) - how to
shut down the child, either immediately or by giving it time to shut down

For example:

use GenServer, restart: :transient, shutdown: 10_000

See the "Child specification" section in the `Supervisor` module for more
See the ["Child specification"](`m:Supervisor#module-child_spec-1-function`) section in the `Supervisor` module for more
detailed information. The `@doc` annotation immediately preceding
`use GenServer` will be attached to the generated `child_spec/1` function.

Expand Down
4 changes: 2 additions & 2 deletions lib/elixir/lib/supervisor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ defmodule Supervisor do
to start the child process. This key is required.

* `:restart` - an atom that defines when a terminated child process
should be restarted (see the "Restart values" section below).
should be restarted (see the ["Restart values"](#module-restart-values-restart) section below).
This key is optional and defaults to `:permanent`.

* `:shutdown` - an integer or atom that defines how a child process should
be terminated (see the "Shutdown values" section below). This key
be terminated (see the ["Shutdown values"](#module-shutdown-values-shutdown) section below). This key
is optional and defaults to `5_000` if the type is `:worker` or
`:infinity` if the type is `:supervisor`.

Expand Down
Loading