Skip to content

Instantly share code, notes, and snippets.

@hackervera
Created September 22, 2010 01:16
Show Gist options
  • Select an option

  • Save hackervera/590939 to your computer and use it in GitHub Desktop.

Select an option

Save hackervera/590939 to your computer and use it in GitHub Desktop.
def yum(arg)
sleep 10
puts arg
end
def async(arg, callback)
thr = Thread.new { eval(callback.call(arg)) }
thr
end
thr = async("foo","yum")
thr.join
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment