summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyoko KADOWAKI <kdxu@users.noreply.github.com>2017-12-04 11:54:26 +0900
committerJames Fish <james@fishcakez.com>2017-12-03 18:54:26 -0800
commitdb85115a1f3cbb0b1cfbe1bfc8593cc1121f56a1 (patch)
tree802e25ff8daccbc1b3600147a9aaa30a7f52b624
parent3086b68636b795556824aef36a9938b2286a2238 (diff)
downloadelixir-db85115a1f3cbb0b1cfbe1bfc8593cc1121f56a1.tar.gz
Fix the documentation for Dynamic Supervisor (#7086)
-rw-r--r--lib/elixir/lib/dynamic_supervisor.ex6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/elixir/lib/dynamic_supervisor.ex b/lib/elixir/lib/dynamic_supervisor.ex
index cc1ad1f38..0acfa8995 100644
--- a/lib/elixir/lib/dynamic_supervisor.ex
+++ b/lib/elixir/lib/dynamic_supervisor.ex
@@ -20,16 +20,16 @@ defmodule DynamicSupervisor do
Once the dynamic supervisor is running, we can start children
with `start_child/2`, which receives a child specification:
- {:ok, agent1} = DynamicSupervisor.start_link(sup, {Agent, fn -> %{} end})
+ {:ok, agent1} = DynamicSupervisor.start_child(sup, {Agent, fn -> %{} end})
Agent.update(agent1, &Map.put(&1, :key, "value"))
Agent.get(agent1, & &1)
#=> %{key: "value"}
- {:ok, agent2} = DynamicSupervisor.start_link(sup, {Agent, fn -> %{} end})
+ {:ok, agent2} = DynamicSupervisor.start_child(sup, {Agent, fn -> %{} end})
Agent.get(agent2, & &1)
#=> %{}
- DynamicSupervisor.count_children(sup_pid)
+ DynamicSupervisor.count_children(sup)
#=> %{active: 2, specs: 2, supervisors: 0, workers: 2}
## Module-based supervisors