Last active
November 9, 2017 18:54
-
-
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
This file contains 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
# 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