Closed jacob-pro closed 2 years ago
Ok so I've had a go at implementing this myself here, which seems to work:
https://github.com/jacob-pro/hyper-graceful
It is largely inspired on the tokio docs (using a broadcast to shutdown workers, and an mpsc to wait for them to complete):
Superceded by #2862
I am currently using the low-level Http server API, which seems to suit my usage much better (https://github.com/hyperium/hyper/issues/2321)
But I am wondering how can I do a graceful shutdown, I currently have a run loop that looks like:
But what I would really like is some way of polling the remaining requests before exiting the server.
Something like that was proposed by @seanmonstar here: https://github.com/hyperium/hyper/issues/2321#issuecomment-734019314