This repository was archived by the owner on Jul 14, 2025. It is now read-only.
Open
Conversation
Signed-off-by: Li Yi <denverdino@gmail.com>
Contributor
|
Sorry for the lack of reply - I've been away. Thanks for this - I'll take a look! |
itowlson
suggested changes
Jun 7, 2022
Contributor
itowlson
left a comment
There was a problem hiding this comment.
Couple of things, hopefully minor. Thanks!
| use hyper::{Body, Response, Server}; | ||
| use tokio::net::TcpStream; | ||
| use tokio_rustls::server::TlsStream; | ||
| use tokio::signal::unix::SignalKind; |
Contributor
There was a problem hiding this comment.
Will this work on Windows? Might need to be conditionally compiled...
| .await?; | ||
| let server = Server::builder(tls::TlsHyperAcceptor::new(&self.address, &tls.cert_path, &tls.key_path).await?) | ||
| .serve(mk_svc); | ||
| let graceful = server.with_graceful_shutdown(shutdown_signal()); |
Contributor
There was a problem hiding this comment.
We had problems with with_graceful_shutdown in Spin because it kept the process alive until all connections had closed, which could be a couple of minutes due to keep-alives. See spinframework/spin#73 for the problem and links to relevant Hyper issues, and spinframework/spin#232 for how we solved it there.
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Signed-off-by: Li Yi denverdino@gmail.com
Fix #182
Tested in Mac/Linux
In the separated terminal