Skip to content

Commit 408bbbc

Browse files
author
José Valim
committed
Publicly document child_spec/1
1 parent ae8502d commit 408bbbc

File tree

6 files changed

+50
-9
lines changed

6 files changed

+50
-9
lines changed

lib/elixir/lib/agent.ex

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,12 @@ defmodule Agent do
139139
@typedoc "The agent state"
140140
@type state :: term
141141

142-
@doc false
142+
@doc """
143+
Returns a specification to start an agent under a supervisor.
144+
145+
See `Supervisor`.
146+
"""
147+
@since "1.5.0"
143148
def child_spec(arg) do
144149
%{
145150
id: Agent,
@@ -150,7 +155,11 @@ defmodule Agent do
150155
@doc false
151156
defmacro __using__(opts) do
152157
quote location: :keep, bind_quoted: [opts: opts] do
153-
@doc false
158+
@doc """
159+
Returns a specification to start this module under a supervisor.
160+
161+
See `Supervisor`.
162+
"""
154163
def child_spec(arg) do
155164
default = %{
156165
id: __MODULE__,

lib/elixir/lib/dynamic_supervisor.ex

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,12 @@ defmodule DynamicSupervisor do
173173
restarts: []
174174
]
175175

176-
@doc false
176+
@doc """
177+
Returns a specification to start a dynamic supervisor under a supervisor.
178+
179+
See `Supervisor`.
180+
"""
181+
@since "1.6.1"
177182
def child_spec(arg) do
178183
%{
179184
id: DynamicSupervisor,
@@ -187,7 +192,11 @@ defmodule DynamicSupervisor do
187192
quote location: :keep, bind_quoted: [opts: opts] do
188193
@behaviour DynamicSupervisor
189194

190-
@doc false
195+
@doc """
196+
Returns a specification to start this module under a supervisor.
197+
198+
See `Supervisor`.
199+
"""
191200
def child_spec(arg) do
192201
default = %{
193202
id: __MODULE__,

lib/elixir/lib/gen_server.ex

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,11 @@ defmodule GenServer do
570570
quote location: :keep, bind_quoted: [opts: opts] do
571571
@behaviour GenServer
572572

573-
@doc false
573+
@doc """
574+
Returns a specification to start this module under a supervisor.
575+
576+
See `Supervisor`.
577+
"""
574578
def child_spec(arg) do
575579
default = %{
576580
id: __MODULE__,

lib/elixir/lib/registry.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,12 @@ defmodule Registry do
326326
start_link([keys: keys, name: name] ++ options)
327327
end
328328

329-
@doc false
329+
@doc """
330+
Returns a specification to start a registry under a supervisor.
331+
332+
See `Supervisor`.
333+
"""
334+
@since "1.5.0"
330335
def child_spec(opts) do
331336
%{
332337
id: Keyword.get(opts, :name, Registry),

lib/elixir/lib/supervisor.ex

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,11 @@ defmodule Supervisor do
461461
import Supervisor.Spec
462462
@behaviour Supervisor
463463

464-
@doc false
464+
@doc """
465+
Returns a specification to start this module under a supervisor.
466+
467+
See `Supervisor`.
468+
"""
465469
def child_spec(arg) do
466470
default = %{
467471
id: __MODULE__,

lib/elixir/lib/task.ex

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,12 @@ defmodule Task do
173173

174174
@type t :: %__MODULE__{}
175175

176-
@doc false
176+
@doc """
177+
Returns a specification to start a task under a supervisor.
178+
179+
See `Supervisor`.
180+
"""
181+
@since "1.5.0"
177182
def child_spec(arg) do
178183
%{
179184
id: Task,
@@ -185,7 +190,12 @@ defmodule Task do
185190
@doc false
186191
defmacro __using__(opts) do
187192
quote location: :keep, bind_quoted: [opts: opts] do
188-
@doc false
193+
@doc """
194+
Returns a specification to start this module under a supervisor.
195+
196+
See `Supervisor`.
197+
"""
198+
@since "1.5.0"
189199
def child_spec(arg) do
190200
default = %{
191201
id: __MODULE__,

0 commit comments

Comments
 (0)