Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRubyFibers and the schedulerSingle-choice MCQ

This code uses Fiber with explicit resume/yield. What does it print and why?

f = Fiber.new do |a| puts a * 2 x = Fiber.yield puts x + a end f.resume(5) f.resume(20)