Skip to content

Instantly share code, notes, and snippets.

@TylerPachal
Last active November 9, 2017 19:02
Show Gist options
  • Save TylerPachal/17d2c996a32defc2aa4e118c6f3e7f04 to your computer and use it in GitHub Desktop.
Save TylerPachal/17d2c996a32defc2aa4e118c6f3e7f04 to your computer and use it in GitHub Desktop.
Starting up a MySupervisor process and verifying that is has linked to child processes
# Start a supervisor with two child specifications
iex(1)> {:ok, pid} = MySupervisor.start_link([{Parser, :start_link, []}, {Parser, :start_link, []}])
{:ok, #PID<0.123.0>}
# See the two processes that the supervisor started
iex(2)> MySupervisor.list_processes(pid)
%{#PID<0.124.0> => {Parser, :start_link, []},
#PID<0.125.0> => {Parser, :start_link, []}}
# Verify the supervisor has linked to the processes
iex(3)> Process.info(pid, :links)
{:links, [#PID<0.124.0>, #PID<0.125.0>, #PID<0.121.0>]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment