Skip to content

Instantly share code, notes, and snippets.

@MonkeyIsNull
Created May 20, 2015 16:52
Show Gist options
  • Save MonkeyIsNull/cd4e87dd5b3a757dcfaa to your computer and use it in GitHub Desktop.
Save MonkeyIsNull/cd4e87dd5b3a757dcfaa to your computer and use it in GitHub Desktop.
defmodule Taskrun do
def run(num) do
IO.puts "running sleep task: #{num}"
:timer.sleep(num)
num
end
def launch(num) do
Task.async(Taskrun, :run, [num])
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment