General

Profile

sdwolfz (Codruț Gușoi)

  • Login: sdwolfz
  • Registered on: 11/16/2020
  • Last sign in: 10/23/2025

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 0 2 2

Activity

10/18/2025

01:34 PM Ruby Feature #19326: Please add a better API for passing a Proc to a Ractor
byroot (Jean Boussier) wrote in #note-13:
> I think we can close now?
```ruby
require 'pp'
class Worker
def initialize(*args, &block)
@args = args
@block = Ractor.shareable_proc(&block)
end
def run(count)
...
sdwolfz (Codruț Gușoi)

09/24/2025

06:51 PM Ruby Feature #19326: Please add a better API for passing a Proc to a Ractor
https://github.com/ruby/ruby/commit/55b1ba3bf276ba82173bd961fb8e0f08bf4182a6
Looks like this commit addresses the issue. I will try it out when the new version releases.
sdwolfz (Codruț Gușoi)

01/22/2023

07:45 PM Ruby Feature #19326: Please add a better API for passing a Proc to a Ractor
New example:
```ruby
class Worker
def initialize(&block)
@block = block
end
def start
block = Ractor.make_shareable(@block)
@ractor = Ractor.new(block) do |callable|
message = receive
callable.call(messa...
sdwolfz (Codruț Gușoi)

01/21/2023

06:19 PM Ruby Feature #19326: Please add a better API for passing a Proc to a Ractor
> I thought Ractor.new would only accept literal blocks.
I hope not, passing an arbitrary block helps with building functionality on top of Ractors (that I want to do).
> ...
My "Worker" class will have documentation stating that s...
sdwolfz (Codruț Gușoi)
07:07 AM Ruby Feature #19326: Please add a better API for passing a Proc to a Ractor
OK, I had absolutely no idea you could do that. Thanks for the suggestion! My impressions was `instance_eval` could only be used around where a block is *written*.
Can we document this behaviour somewhere? Maybe in https://docs.ruby-l...
sdwolfz (Codruț Gușoi)

01/08/2023

07:31 PM Ruby Feature #19326 (Closed): Please add a better API for passing a Proc to a Ractor
Example 1:
```ruby
class Worker
def initialize(&block)
@block = block
end
def run
Ractor.new(@block, &:call)
end
end
worker = Worker.new { 1 }
puts worker.run.take
```
Errors with:
```
<internal:racto...
sdwolfz (Codruț Gușoi)

11/16/2020

02:37 PM Ruby Feature #17328 (Rejected): Extend `un.rb` to be usable by everyone
I've opened the PR here: https://github.com/ruby/ruby/pull/3771, although if you need me to submit a patch just let me know.
Basically I want to be able to use `ruby -run` for more than just running a http server, and thought it could r...
sdwolfz (Codruț Gușoi)

Also available in: Atom