Created
March 22, 2016 12:33
-
-
Save bcardarella/e37cae99cc4e2baaa22c to your computer and use it in GitHub Desktop.
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
defmodule ElixirDaze.Foobar do | |
require Logger | |
def start_link do | |
{:ok, spawn(__MODULE__, :foo, [0])} | |
end | |
def foo(count) do | |
Logger.info(count) | |
if count > 5 do | |
raise "Ruh roh!" | |
end | |
:timer.sleep 2000 | |
foo(count + 1) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment