Skip to content

Instantly share code, notes, and snippets.

@TylerPachal
Last active November 9, 2017 19:03
Show Gist options
  • Save TylerPachal/a07c7e07ead89899c743fc1c30a312e7 to your computer and use it in GitHub Desktop.
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
# 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