Skip to content

Instantly share code, notes, and snippets.

@TylerPachal
Last active November 9, 2017 18:54
Show Gist options
  • Save TylerPachal/4bbcf1fd02b1b3b19baf61775998ddca to your computer and use it in GitHub Desktop.
Save TylerPachal/4bbcf1fd02b1b3b19baf61775998ddca to your computer and use it in GitHub Desktop.
Example usage of the Parser module, which crashes the parent process when it crashes
# Create a new Parser process
iex(2)> {:ok, pid} = Parser.start_link()
{:ok, #PID<0.118.0>}
# Verify the process is alive
iex(3)> Process.alive?(pid)
true
# Send it a valid message
iex(4)> GenServer.call(pid, "100")
100
# Send it an invalid message
iex(5)> GenServer.call(pid, "tyler")
** (EXIT from #PID<0.115.0>) evaluator process exited with reason: an exception was raised:
# Stacktrace here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment