Created
September 22, 2010 01:16
-
-
Save hackervera/590939 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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