hyper-util icon indicating copy to clipboard operation
hyper-util copied to clipboard

#2862: GracefulShutdown utility

Open GlenDC opened this issue 1 year ago • 2 comments

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.

GlenDC avatar Mar 13 '24 13:03 GlenDC

Maybe best to start a new discussion here @dswij if you have further questions on the ones raised in the original PR.

GlenDC avatar Mar 13 '24 13:03 GlenDC

Merge conflict are also resolved.

GlenDC avatar Mar 13 '24 13:03 GlenDC

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...

seanmonstar avatar May 21 '24 22:05 seanmonstar

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.

GlenDC avatar May 22 '24 04:05 GlenDC

I do think porting those internals is a good starting place. The public API you have here is great for users.

seanmonstar avatar May 22 '24 11:05 seanmonstar

Perfect. Then I'll look into that in the coming days so this PR can progress

GlenDC avatar May 22 '24 20:05 GlenDC

Superseded by https://github.com/hyperium/hyper-util/pull/127.

GlenDC avatar May 27 '24 20:05 GlenDC