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

Replace Webrick with custom simple http server #1030

Merged

Conversation

dixpac
Copy link
Contributor

@dixpac dixpac commented Aug 5, 2023

This commit removes Webrick and replaces it with a (simple) custom HttpServer.

This is a single-process/singe-thread server that behaves similarly to webrick.

Initially I've build this implementation to comfort to Rack::Handler interface, but looks like rack team is removing Rack::Handler from the rack gem into separate gem and I'm not sure about the future of Rack::Handler, so i reverted to this implementation.

Resolves #1017

@dixpac dixpac force-pushed the dix/implement_custom_http_server branch from c9833e7 to 227b6f8 Compare August 5, 2023 10:48
@@ -46,6 +46,9 @@ Layout/ParameterAlignment:
Lint/AmbiguousBlockAssociation:
Enabled: false

Lint/IncompatibleIoSelectWithFiberScheduler:
Copy link
Contributor Author

@dixpac dixpac Aug 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fiber-aware scheduling, instead of ths
ready_sockets, = IO.select([@server])
this:
@server.wait_readable

But afaik Ruby 2.x.x, doesn't have fiber-aware scheduling or wait_readable, so I've disabled this linter.

@dixpac dixpac marked this pull request as draft August 5, 2023 11:18
@dixpac dixpac force-pushed the dix/implement_custom_http_server branch 5 times, most recently from 215f502 to 24d8341 Compare August 6, 2023 12:12
This commit removes Webrick and replaces it with a (simple) custom
HttpServer.

This is a single-process/singe-thread server that behaves simmilary to
webrick.
@dixpac dixpac force-pushed the dix/implement_custom_http_server branch from 24d8341 to 20fcda2 Compare August 6, 2023 12:29
@dixpac dixpac marked this pull request as ready for review August 6, 2023 12:42
@bensheldon bensheldon added the refactor Code changes that do not introduce new features label Aug 6, 2023
@bensheldon bensheldon merged commit 14c0a7b into bensheldon:main Aug 6, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code changes that do not introduce new features
Projects
Development

Successfully merging this pull request may close these issues.

Replace webrick with a small/simple custom rack-compatible http server
2 participants