Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

Fiber.blocking

[T] () { (::Fiber) -> T } -> T
Fiber.blocking{|fiber| ...} → result

Forces the fiber to be blocking for the duration of the block. Returns the result of the block.

See the “Non-blocking fibers” section in class docs for details.

See also .blocking? #blocking? .[]= .[] also in 4.0 · 3.4 · 3.3 · 3.2