Skip to content

Instantly share code, notes, and snippets.

@apeiros
Created May 31, 2013 10:11
Show Gist options
  • Save apeiros/c9ad518d2fe35e79ff43 to your computer and use it in GitHub Desktop.
Save apeiros/c9ad518d2fe35e79ff43 to your computer and use it in GitHub Desktop.
module Kernel
def future(*args, &block)
t = Thread.new(*args, &block)
proc { t.value }
end
module_function :future
end
f = future { sleep(2); 10 }
puts "weee, no block!"
puts f.call
puts "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment