Skip to content

Commit 43d2d60

Browse files
committed
Use correct timeout value
1 parent b4c692d commit 43d2d60

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/HummingbirdHTTP2/HTTP2Channel.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,11 @@ public struct HTTP2UpgradeChannel: HTTPChannelHandler {
116116
case timer
117117
case stream(HTTP1Channel.Value)
118118
}
119+
// sequence to trigger graceful shutdown
119120
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
121124
let mergedSequence = merge(
122125
multiplexer.inbound.map { MergeResult.stream($0) },
123126
timerSequence.map { _ in .timer },
@@ -126,6 +129,7 @@ public struct HTTP2UpgradeChannel: HTTPChannelHandler {
126129
do {
127130
try await withGracefulShutdownHandler {
128131
try await withThrowingDiscardingTaskGroup { group in
132+
// stream state.
129133
let streamState = NIOLockedValueBox(HTTP2StreamState())
130134
loop:
131135
for try await element in mergedSequence

0 commit comments

Comments
 (0)