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.yield

(*untyped) -> untyped
Fiber.yield(args, ...) → obj

Yields control back to the context that resumed the fiber, passing along any arguments that were passed to it. The fiber will resume processing at this point when resume is called next. Any arguments passed to the next resume will be the value that this Fiber.yield expression evaluates to.

See also .set_scheduler #alive? .scheduler #backtrace also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0