Allow driving server using user-provided runtime. #19
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.
This makes the API more similar to hyper 0.12. Specifically, it allows the user
to use
server::Http::serve_*
for more fine-grained handling ofincoming connections. The existing
server::Server::run
still exists to allowan easy way of synchronously starting up a server on a new tokio runtime.
Other changes:
Fix and enable doctests on Server and Http.
Fix server example to delete the socket if it exists before binding to it,
so that it can be run more than once.
Note that this has semver-major breaking changes.
Http::bind
is nowServer::bind
(similar tohyper::Server
),Server::local_addr
always succeeds, and some of the generic bounds are different.