From db85115a1f3cbb0b1cfbe1bfc8593cc1121f56a1 Mon Sep 17 00:00:00 2001 From: Kyoko KADOWAKI Date: Mon, 4 Dec 2017 11:54:26 +0900 Subject: Fix the documentation for Dynamic Supervisor (#7086) --- lib/elixir/lib/dynamic_supervisor.ex | 6 +++--- 1 file 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 -- cgit v1.2.1