Issue #17331 has been updated by nevans (Nicholas Evans).

Description updated

I added an alternate implicit implementation at Samuel Williams's request: https://github.com/ruby/ruby/pull/3795

It will automatically choose between `rb_fiber_transfer_kw` for transferring fibers and `rb_fiber_resume_kw` for yielding fibers. It will not work on resuming fibers. I prefer the explicit version.

----------------------------------------
Feature #17331: Let Fiber#raise work with transferring fibers
https://bugs.ruby-lang.org/issues/17331#change-88642

* Author: nevans (Nicholas Evans)
* Status: Open
* Priority: Normal
----------------------------------------
This seems like a feature that would be just as useful for transferring fibers as it is for yielding fibers.

I'm using a kwarg, so this is not automatic; the caller must know how to handle the fiber.  If you call a yielding fiber with `transfer: true` or a transferring fiber without `transfer: true`, a `FiberError` will be raised.

```ruby
yielding_fiber.raise "message"
transferring_fiber.raise "message", transfer: true
```

Implementation: https://github.com/ruby/ruby/pull/3783
Alternate implicit implementation: https://github.com/ruby/ruby/pull/3795



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>