Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Fiber#blocking?
() -> bool
fiber.blocking? → true or false
cont.c
View on GitHub ↗
VALUE
rb_fiber_blocking_p(VALUE fiber)
{
return RBOOL(fiber_ptr(fiber)->blocking);
}
Returns true if fiber is blocking and false otherwise. Fiber is non-blocking if it was created via passing blocking: false to Fiber.new, or via Fiber.schedule.
Note that, even if the method returns false, the fiber behaves differently only if Fiber.scheduler is set in the current thread.
See the “Non-blocking fibers” section in class docs for details.
Ruby version changes
-
3.0
-
Fiber#blocking?tells whether the fiber is non-blocking. [Feature #16786]
-
See also
.blocking
.blocking?
#backtrace_locations
#inspect
also in
4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0