Skip to content

Instantly share code, notes, and snippets.

@bcardarella
Created March 22, 2016 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bcardarella/e37cae99cc4e2baaa22c to your computer and use it in GitHub Desktop.
Save bcardarella/e37cae99cc4e2baaa22c to your computer and use it in GitHub Desktop.
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