摘要: Fiber可以让程序分段执行。fiber.rbfiber = Fiber.new do puts "before yield" Fiber.yield 1 puts "after yield" 2endputs "before resume1"puts fiber.resumeputs "before resume2"puts fiber.resumeputs "before resume3"puts fiber.resumeputs "after resume"结果:bef 阅读全文
posted @ 2013-07-25 13:54 Leo Forest 阅读(378) 评论(0) 推荐(0) 编辑