Commits

Michael  committed 139d608

ruby 1.9 fibers

  • Participants
  • Parent commits 039b1ef

Comments (0)

Files changed (1)

File ruby/concurrency.rb

+#!/usr/bin/env ruby
+
+fibs = Fiber.new do
+  a = b = 1
+  loop do
+    Fiber.yield a
+    a, b = b, a + b
+  end
+end
+
+10.times { p fibs.resume }