End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Fiber::SchedulerInterface#kernel_sleep
kernel_sleep(duration = nil)
cont.c
View on GitHub ↗
static VALUE
rb_fiber_scheduler_interface_kernel_sleep(VALUE self)
{
}
Invoked by Kernel#sleep and Mutex#sleep and is expected to provide an implementation of sleeping in a non-blocking way. Implementation might register the current fiber in some list of “which fiber wait until what moment”, call Fiber.yield to pass control, and then in close resume the fibers whose wait period has elapsed.