Project

General

Profile

Actions

Feature #17404

open

Ractor `move:` API to allow shareability check

Added by marcandre (Marc-Andre Lafortune) over 3 years ago. Updated 20 days ago.

Status:
Assigned
Target version:
-
[ruby-core:101499]

Description

I'd like to ractor.send(message) and express that message should be shareable. Currently I'm given two choices: move: true and move: false / nothing, neither of which have an effect if my message is shareable, and neither of which will tell me in case there's a bug in my program and message is not shareable.

Could we consider a slightly different API (for 3.0 or 3.1)?

ractor.send(message, pass: :copy) # => like current `move: false`
ractor.send(message, pass: :move) # => like current `move: true`
ractor.send(message, pass: :share) # => raise in case message is not shareable
ractor.send(message) # => same as `pass: :copy`
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0