Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Fiber::Scheduler#fiber
fiber(&block)
scheduler.c
View on GitHub ↗
Implementation of the Fiber.schedule. The method is expected to immediately run the given block of code in a separate non-blocking fiber, and to return that Fiber.
Minimal suggested implementation is:
Example
def fiber(&block) fiber = Fiber.new(blocking: false, &block) fiber.resume fiber end