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

Thread scheduler for light weight concurrency. #3032

Merged
merged 1 commit into from May 14, 2020

Conversation

ioquatix
Copy link
Member

@ioquatix ioquatix commented Apr 14, 2020

Please see https://bugs.ruby-lang.org/issues/16786 for discussion.

@MSP-Greg
Copy link
Contributor

@ioquatix

Maybe sometihing like the following in test/io/nonblock/http.rb and test/io/nonblock/test_http.rb:

http = Net::HTTP.new uri.host, uri.port
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
body = http.get(uri.path).body

Seemed to work in my fork...

@ioquatix
Copy link
Member Author

@MSP-Greg thanks, it's 4AM and that code really helps me out.

@ioquatix ioquatix force-pushed the thread-scheduler branch 2 times, most recently from 3769ff6 to 3e86fe4 Compare April 14, 2020 16:11
@MSP-Greg
Copy link
Contributor

Now that I'm awake, a block might be better...

Net::HTTP.start(uri.host, uri.port) do |http|
  # ...
end

@ioquatix
Copy link
Member Author

Now that I'm awake...

@MSP-Greg I'm pretty sure I was not awake last night when trying to write that code lol...

@ioquatix
Copy link
Member Author

ioquatix commented May 8, 2020

I have rebased on master.

@ioquatix ioquatix merged commit 0e3b0fc into ruby:master May 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants