摘要:
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 阅读全文