Last active
August 3, 2022 00:27
-
-
Save petermueller/8c2dbbfa61e577fafbab9329bd7b6355 to your computer and use it in GitHub Desktop.
Revisions
-
felix-starman revised this gist
Jun 23, 2020 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,3 +23,7 @@ end # {:ok, sup_pid} = Supervisor.start_link([MyMod], name: MySup, strategy: :one_for_one) {:ok, sup_pid} = Supervisor.start_link([{MyMod, test: :value}], name: MySup, strategy: :one_for_one) Supervisor.stop(sup_pid) # *** MyMod.child_spec/1: [test: :value] # *** MyMod.start_link/1: [test: :value] # *** MyMod.init/1: [test: :value] -
felix-starman created this gist
May 18, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ defmodule MyMod do use GenServer def child_spec(args) do IO.inspect(args, label: "*** MyMod.child_spec/1") %{ id: __MODULE__, start: {__MODULE__, :start_link, [args]} } end def start_link(args) do IO.inspect(args, label: "*** MyMod.start_link/1") GenServer.start_link(__MODULE__, args) end def init(args) do IO.inspect(args, label: "*** MyMod.init/1") {:ok, args} end end # {:ok, sup_pid} = Supervisor.start_link([MyMod], name: MySup, strategy: :one_for_one) {:ok, sup_pid} = Supervisor.start_link([{MyMod, test: :value}], name: MySup, strategy: :one_for_one) Supervisor.stop(sup_pid)