Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
Fiber.scheduler
() -> untyped?
Fiber.scheduler → obj or nil
cont.c
View on GitHub ↗
static VALUE
rb_fiber_s_scheduler(VALUE klass)
{
return rb_fiber_scheduler_get();
}
Returns the Fiber scheduler, that was last set for the current thread with Fiber.set_scheduler. Returns nil if no scheduler is set (which is the default), and non-blocking fibers’ behavior is the same as blocking. (see “Non-blocking fibers” section in class docs for details about the scheduler concept).
Ruby version changes
-
3.0
-
Introduce
Fiber.set_schedulerfor intercepting blocking operations andFiber.schedulerfor accessing the current scheduler. See fiber.md for more details about what operations are supported and how to implement the scheduler hooks. [Feature #16786]
-