ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:100551] [Ruby master Feature#17286] `Ractor.new` should accept `move: true`
@ 2020-10-26  5:10 marcandre-ruby-core
  2020-10-26 15:26 ` [ruby-core:100575] " ko1
  2020-11-08  3:01 ` [ruby-core:100742] " marcandre-ruby-core
  0 siblings, 2 replies; 3+ messages in thread
From: marcandre-ruby-core @ 2020-10-26  5:10 UTC (permalink / raw)
  To: ruby-core

Issue #17286 has been reported by marcandre (Marc-Andre Lafortune).

----------------------------------------
Feature #17286: `Ractor.new` should accept `move: true`
https://bugs.ruby-lang.org/issues/17286

* Author: marcandre (Marc-Andre Lafortune)
* Status: Open
* Priority: Normal
----------------------------------------
Another surprise when writing my backport is that `Ractor.new` does not accept `move:` keyword argument.

```ruby
Ractor.new(val, move: true) { |data| ... }
# equivalent to
Ractor.new { data = Ractor.receive; ... }.tap { |r| r.send(val, move: true) }
```




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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:100575] [Ruby master Feature#17286] `Ractor.new` should accept `move: true`
  2020-10-26  5:10 [ruby-core:100551] [Ruby master Feature#17286] `Ractor.new` should accept `move: true` marcandre-ruby-core
@ 2020-10-26 15:26 ` ko1
  2020-11-08  3:01 ` [ruby-core:100742] " marcandre-ruby-core
  1 sibling, 0 replies; 3+ messages in thread
From: ko1 @ 2020-10-26 15:26 UTC (permalink / raw)
  To: ruby-core

Issue #17286 has been updated by ko1 (Koichi Sasada).


I'm also thinking about this feature, and the problem is, maybe we should choose move or copy on each parameters:

```ruby
Ractor.new io,  # want to move
           str  # want to copy
do |io, str|
  io.puts str
end
```

and I have no good idea about it.

```ruby
Ractor.new Ractor.move(io), str do...
```

is one idea (wrap with special object for passing argument), but not sure it is the best....

----------------------------------------
Feature #17286: `Ractor.new` should accept `move: true`
https://bugs.ruby-lang.org/issues/17286#change-88207

* Author: marcandre (Marc-Andre Lafortune)
* Status: Open
* Priority: Normal
----------------------------------------
Another surprise when writing my backport is that `Ractor.new` does not accept `move:` keyword argument.

```ruby
Ractor.new(val, move: true) { |data| ... }
# equivalent to
Ractor.new { data = Ractor.receive; ... }.tap { |r| r.send(val, move: true) }
```




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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:100742] [Ruby master Feature#17286] `Ractor.new` should accept `move: true`
  2020-10-26  5:10 [ruby-core:100551] [Ruby master Feature#17286] `Ractor.new` should accept `move: true` marcandre-ruby-core
  2020-10-26 15:26 ` [ruby-core:100575] " ko1
@ 2020-11-08  3:01 ` marcandre-ruby-core
  1 sibling, 0 replies; 3+ messages in thread
From: marcandre-ruby-core @ 2020-11-08  3:01 UTC (permalink / raw)
  To: ruby-core

Issue #17286 has been updated by marcandre (Marc-Andre Lafortune).


I'd say let's start with a simple version and see what use-cases come up.

Seems already possible to mix and match anyways... Open the Ractor with one mode and `yield` the other parameters using the other mode.

----------------------------------------
Feature #17286: `Ractor.new` should accept `move: true`
https://bugs.ruby-lang.org/issues/17286#change-88390

* Author: marcandre (Marc-Andre Lafortune)
* Status: Open
* Priority: Normal
----------------------------------------
Another surprise when writing my backport is that `Ractor.new` does not accept `move:` keyword argument.

```ruby
Ractor.new(val, move: true) { |data| ... }
# equivalent to
Ractor.new { data = Ractor.receive; ... }.tap { |r| r.send(val, move: true) }
```




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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-08  3:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26  5:10 [ruby-core:100551] [Ruby master Feature#17286] `Ractor.new` should accept `move: true` marcandre-ruby-core
2020-10-26 15:26 ` [ruby-core:100575] " ko1
2020-11-08  3:01 ` [ruby-core:100742] " marcandre-ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).