File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -116,8 +116,11 @@ public struct HTTP2UpgradeChannel: HTTPChannelHandler {
116
116
case timer
117
117
case stream( HTTP1Channel . Value )
118
118
}
119
+ // sequence to trigger graceful shutdown
119
120
let ( gracefulShutdownSequence, gracefulShutdownSource) = AsyncStream< Void> . makeStream( )
120
- let timerSequence = AsyncTimerSequence ( interval: . seconds( 1 ) , clock: . continuous)
121
+ // timer sequence
122
+ let timerSequence = AsyncTimerSequence ( interval: self . idleTimeout, clock: . continuous)
123
+ // merge multiplexer with graceful shutdown and timer
121
124
let mergedSequence = merge (
122
125
multiplexer. inbound. map { MergeResult . stream ( $0) } ,
123
126
timerSequence. map { _ in . timer } ,
@@ -126,6 +129,7 @@ public struct HTTP2UpgradeChannel: HTTPChannelHandler {
126
129
do {
127
130
try await withGracefulShutdownHandler {
128
131
try await withThrowingDiscardingTaskGroup { group in
132
+ // stream state.
129
133
let streamState = NIOLockedValueBox ( HTTP2StreamState ( ) )
130
134
loop:
131
135
for try await element in mergedSequence
You can’t perform that action at this time.
0 commit comments