hyper-util
hyper-util copied to clipboard
#2862: GracefulShutdown utility
Closes https://github.com/hyperium/hyper/issues/2862
Adds a GracefulShutdown utility which:
- is runtime agnostic
- can work with any future
- respects the API as requested in the feature request issue (#2862), taken also into account comments and ideas from this PR;
recreation of https://github.com/hyperium/hyper-util/pull/86
Sorry, created my original repo under the plabayo org, didn't realise that that PR was still attached to it.
Maybe best to start a new discussion here @dswij if you have further questions on the ones raised in the original PR.
Merge conflict are also resolved.
I had this thought: while having an optimized data structure is a nice-to-have, what if this internally used what hyper v0.14.x used, just a pair of mpsc and watch channels? I think they're pretty easy to reason about, and we don't have to worry about subtle bugs. We could probably merge that sooner, and then a specialized data structure could be a follow up.
I could also do that, using this PR as a starting off point...
All the same to me @seanmonstar . Given that you are busy enough as is, I will finish it myself.
Before that, can you please confirm that the above approach proposal of yours (mpcs + watch channels) is what you want. I’ll update this PR code once I have that confirmation.
I do think porting those internals is a good starting place. The public API you have here is great for users.
Perfect. Then I'll look into that in the coming days so this PR can progress
Superseded by https://github.com/hyperium/hyper-util/pull/127.