Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View fiber.rb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
class Fiber
include Enumerable
def each
begin
loop { yield self.resume }
rescue FiberError
end
end
end
 
puts Fiber.new {
Fiber.yield 3
Fiber.yield 2
Fiber.yield 1
Fiber.yield 0
}.to_enum.to_a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.