-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Allow specifying the desired IO selector backend for nio4r #2522
Allow specifying the desired IO selector backend for nio4r #2522
Conversation
nio4r will soon have experimental support for io_uring via libev. The brave might want to try it out :) regardless of that, allowing users to explicitly set the IO selector backend seems like a good idea to me.
Oops!
Thanks! Left some comments, lmk what you think. |
dd93c03
to
060e664
Compare
060e664
to
7c5e6dd
Compare
Thank you! I updated the docs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rescue the ArgumentError
coming from nio4r and raise a better one?
It is not that clear that it is coming from nio4r:
$ grep io_selector_backend test/config/app.rb
io_selector_backend :ruby
Puma starting in single mode...
* Puma version: 5.1.1 (ruby 2.7.1-p83) ("At Your Service")
* Min threads: 0
* Max threads: 5
* Environment: development
* PID: 15846
* Listening on http://0.0.0.0:57461
bundler: failed to load command: bin/puma (bin/puma)
Traceback (most recent call last):
23: from /Users/dentarg/.gem/ruby/2.7.1/bin/bundle:23:in `<main>'
22: from /Users/dentarg/.gem/ruby/2.7.1/bin/bundle:23:in `load'
21: from /Users/dentarg/.rubies/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/bundler-2.2.4/exe/bundle:37:in `<top (required)>'
20: from /Users/dentarg/.rubies/ruby-2.7.1/lib/ruby/site_ruby/2.7.0/bundler/friendly_errors.rb:130:in `with_friendly_errors'
19: from /Users/dentarg/.rubies/ruby-2.7.1/lib/ruby/gems/2.7.0/gems/bundler-2.2.4/exe/bundle:49:in `block in <top (required)>'
18: from /Users/dentarg/.rubies/ruby-2.7.1/lib/ruby/site_ruby/2.7.0/bundler/cli.rb:24:in `start'
17: from /Users/dentarg/.rubies/ruby-2.7.1/lib/ruby/site_ruby/2.7.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
16: from /Users/dentarg/.rubies/ruby-2.7.1/lib/ruby/site_ruby/2.7.0/bundler/cli.rb:30:in `dispatch'
15: from /Users/dentarg/.rubies/ruby-2.7.1/lib/ruby/site_ruby/2.7.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
14: from /Users/dentarg/.rubies/ruby-2.7.1/lib/ruby/site_ruby/2.7.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
13: from /Users/dentarg/.rubies/ruby-2.7.1/lib/ruby/site_ruby/2.7.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
12: from /Users/dentarg/.rubies/ruby-2.7.1/lib/ruby/site_ruby/2.7.0/bundler/cli.rb:494:in `exec'
11: from /Users/dentarg/.rubies/ruby-2.7.1/lib/ruby/site_ruby/2.7.0/bundler/cli/exec.rb:28:in `run'
10: from /Users/dentarg/.rubies/ruby-2.7.1/lib/ruby/site_ruby/2.7.0/bundler/cli/exec.rb:63:in `kernel_load'
9: from /Users/dentarg/.rubies/ruby-2.7.1/lib/ruby/site_ruby/2.7.0/bundler/cli/exec.rb:63:in `load'
8: from bin/puma:10:in `<top (required)>'
7: from /Users/dentarg/src/puma/lib/puma/cli.rb:80:in `run'
6: from /Users/dentarg/src/puma/lib/puma/launcher.rb:181:in `run'
5: from /Users/dentarg/src/puma/lib/puma/single.rb:53:in `run'
4: from /Users/dentarg/src/puma/lib/puma/server.rb:241:in `run'
3: from /Users/dentarg/src/puma/lib/puma/server.rb:241:in `new'
2: from /Users/dentarg/src/puma/lib/puma/reactor.rb:23:in `initialize'
1: from /Users/dentarg/src/puma/lib/puma/reactor.rb:23:in `new'
/Users/dentarg/src/puma/lib/puma/reactor.rb:23:in `initialize': unsupported backend: :ruby (ArgumentError)
I hope I addressed all feedback, thank you! Let me know what you think. |
Great work from everyone - @jcmfernandes and reviewers 👍 |
Thank you @nateberkopec and all the reviewers! 🙌 |
* Allow specifying the desired IO selector backend nio4r will soon have experimental support for io_uring via libev. The brave might want to try it out :) regardless of that, allowing users to explicitly set the IO selector backend seems like a good idea to me. * Change History.md * Add PR number * Fix History.md Oops! * Update docs based on PR feedback * Add test serving requests using a custom IO selector * Document the NIO4R_PURE environment variable * Raise clearer error when the requested backend is unsupported * Simply boot the server and check the backend
Description
nio4r will soon have experimental support for io_uring via libev. The brave might want to try it out :) regardless of that, allowing users to explicitly set the IO selector backend seems like a good idea to me.
Your checklist for this pull request
[changelog skip]
or[ci skip]
to the pull request title.[ci skip]
to the title of the PR.#issue
" to the PR description or my commit messages.