Skip to content

alias value take if Ractor#value is not defined #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025
Merged

Conversation

ko1
Copy link
Contributor

@ko1 ko1 commented Jun 3, 2025

Ractor#value was newly introduced but it can be emulated with Ractor#take if Ractor.yield is not used.

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

`Ractor#value` was newly introduced but it can be emulated with `Ractor#take` if `Ractor.yield` is not used.

https://bugs.ruby-lang.org/issues/21262
@eregon
Copy link
Member

eregon commented Jun 4, 2025

This feels wrong because I would never expect a test harness to define extra methods on core classes (except maybe assertions methods).
For instance it might lead people to believe Ractor#value is always available, and a gem might even rely on that, but the method doesn't exist on Ruby 3.4 and would break when someone actually uses it outside the test harness.
I think Ractor#take should be re-added in ruby/ruby (could be deprecated).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants