Created
January 30, 2014 00:15
-
-
Save cheald/8700041 to your computer and use it in GitHub Desktop.
This file contains 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
f = Fiber.new { | |
begin | |
Timeout.timeout(1) { | |
p Fiber.yield("y1") | |
} | |
rescue Exception => e | |
puts e | |
end | |
} | |
p f.resume "resume 1" | |
sleep 1.5 | |
p f.resume "resume 2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment