Skip to content

Instantly share code, notes, and snippets.

@MonkeyIsNull
Created November 5, 2015 14:32
Show Gist options
  • Save MonkeyIsNull/7deb099da777178068e0 to your computer and use it in GitHub Desktop.
Save MonkeyIsNull/7deb099da777178068e0 to your computer and use it in GitHub Desktop.
defmodule Foo do
def sleep(num) do
:timer.sleep(num)
self()
end
end
t = Task.async(fn -> Foo.sleep(15000) end)
IO.inspect Task.await(t, 20000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment