SwiftNIOExtras offers a QuiescingHelper to gracefully shutdown servers. NIOHTTP2Handler should support shutting down a server connection, when the QuiescingHelper sends out a ChannelShouldQuiesceEvent:
- Once
NIOHTTP2Handler receives a ChannelShouldQuiesceEvent a GoAway frame should be send to the client and new incoming streams should be rejected.
- Once all previously open streams have finished the connection should be closed.
In NIOHTTP1 the ChannelShouldQuiesceEvent support is implemented in HTTPServerPipelineHandler