Skip to content
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

[Feature] Ruby 3 Ractor support? #644

Open
zt2 opened this issue Jan 22, 2021 · 0 comments
Open

[Feature] Ruby 3 Ractor support? #644

zt2 opened this issue Jan 22, 2021 · 0 comments

Comments

@zt2
Copy link

zt2 commented Jan 22, 2021

Ruby 3 support Ractor to archive concurrency, Ractor can not access instance variables of classes/modules.

When I want to use Ractor with http, I found http is using access instance variables of classes, for example:

require 'http'

ractors = []
url = 'http://httpbin.org/ip'
10.times do
  ractors << Ractor.new(url) { |u| HTTP.get u }
end
ractors.map(&:take)

This snippet will raise error http-4.4.1/lib/http/chainable.rb:221:in 'default_options': can not access instance variables of classes/modules from non-main Ractors (Ractor::IsolationError), because http using default_options as class instance variable.

Is it possible to make it support Ractor?

@zt2 zt2 changed the title Ruby 3 Ractor support? [Feature] Ruby 3 Ractor support? Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants