Last active
November 9, 2017 19:03
-
-
Save TylerPachal/a07c7e07ead89899c743fc1c30a312e7 to your computer and use it in GitHub Desktop.
Sending messages to a Parser process that is supervised by the first draft of MySupervisor
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
# Get a reference to one of the Parser process pid | |
iex(4)> parser_pid = MySupervisor.list_processes(pid) |> Map.keys |> List.first | |
#PID<0.124.0> | |
# Send a valid message | |
iex(5)> GenServer.call(parser_pid, "100") | |
100 | |
# Send an invalid message | |
iex(6)> GenServer.call(parser_pid, "tyler") | |
** (exit) exited in: GenServer.call(#PID<0.112.0>, "tyler", 5000) | |
# Stacktrace here | |
# Confirm the process died | |
iex(7)> Process.alive?(parser_pid) | |
false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment