-
Notifications
You must be signed in to change notification settings - Fork 173
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
feat(http server): add new builder APIs build_from_tcp
and build_from_hyper
#719
Merged
Merged
Changes from 8 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c63c0fc
unify servers; use tokio::TcpListener
niklasad1 ba3f61c
add API to build server from tcp socket
niklasad1 273a534
Merge remote-tracking branch 'origin/master' into na-tcp-socket-confi…
niklasad1 8d90d22
build_from_tcp nit: not async
niklasad1 51257d0
Merge remote-tracking branch 'origin/master' into na-tcp-socket-confi…
niklasad1 9e23761
fix nits
niklasad1 0c87790
change `build_from_tcp` force users configure hyper
niklasad1 acbfe9b
Update http-server/src/server.rs
niklasad1 358d795
fix doc links
niklasad1 bf306f7
Merge remote-tracking branch 'origin/na-tcp-socket-configurations-api…
niklasad1 0fbe445
add separate APIs `build_from_tcp` and `build_from_hyper`
niklasad1 e3bfbcf
Merge remote-tracking branch 'origin/master' into na-tcp-socket-confi…
niklasad1 2b2e3b9
fix clippy
niklasad1 d21cd0f
remove dead code
niklasad1 b61ecd5
fix build
niklasad1 4711e18
fix nit in example code
niklasad1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@jsdw is this API reasonable?
Basically the only thing I want to ensure is that no settings gets overwritten without informing the users of this API.
It's a bit awkward to configure some settings twice but no way around that....
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.
Aah ok, so the issue is now basically that you can pass in a
TcpListener
, but you can't configure theHyper
server that is created from it.One option might be to keep
build_from_tcp()
as is (which lets you pass in a pre-configured tcp listener but assumes you don't care about how the resulting hyper server is configured), and also have abuild_from_hyper()
as well (which lets you control everything about the tcp listener and hyper server if you wish). So then you'd have:build
-> can't configure socket, can't configure hyper.build_from_tcp
-> can configure tcp socket, can't configure hyper.build_from_hyper
-> can configure tcp, can configure hyper.What do you reckon?
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.
fair enough, I think your suggestion is less awkward.