Last active
November 9, 2017 19:02
-
-
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
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 characters
# 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