From c46c98ffc567df235ff55525ed0e5fe8a6192f3a Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Tue, 4 Jul 2023 11:05:26 +0100 Subject: [PATCH 1/4] Add additional NIOAsyncChannel config Motivation: Recent additions to pipeline configuration did not expose some of the `NIOAsyncChannel` configuration. Modifications: Expose `backpressureStrategy`, `isOutboundHalfClosureEnabled`. I think specific naming and object encapsulation for these parameters should be discussed later before SPI is removed and we review the API as a whole. Result: Pipelie helpers for `NIOAsyncChannel` expose `backpressureStrategy`, `isOutboundHalfClosureEnabled`. --- ...2ChannelHandler+InlineStreamMultiplexer.swift | 6 ++++++ Sources/NIOHTTP2/HTTP2PipelineHelpers.swift | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Sources/NIOHTTP2/HTTP2ChannelHandler+InlineStreamMultiplexer.swift b/Sources/NIOHTTP2/HTTP2ChannelHandler+InlineStreamMultiplexer.swift index f1b12fac..4b3204ba 100644 --- a/Sources/NIOHTTP2/HTTP2ChannelHandler+InlineStreamMultiplexer.swift +++ b/Sources/NIOHTTP2/HTTP2ChannelHandler+InlineStreamMultiplexer.swift @@ -255,7 +255,11 @@ extension NIOHTTP2Handler { /// or ``HTTP2Frame/FramePayload`` if there are none. /// - initializer: A callback that will be invoked to allow you to configure the /// `ChannelPipeline` for the newly created channel. + @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) + @_spi(AsyncChannel) public func createStreamChannel( + backpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, + isOutboundHalfClosureEnabled: Bool = false, inboundType: Inbound.Type, outboundType: Outbound.Type, initializer: @escaping NIOHTTP2Handler.StreamInitializer @@ -264,6 +268,8 @@ extension NIOHTTP2Handler { initializer(channel).flatMapThrowing { _ in return try NIOAsyncChannel( synchronouslyWrapping: channel, + backpressureStrategy: backpressureStrategy, + isOutboundHalfClosureEnabled: isOutboundHalfClosureEnabled, inboundType: Inbound.self, outboundType: Outbound.self ) diff --git a/Sources/NIOHTTP2/HTTP2PipelineHelpers.swift b/Sources/NIOHTTP2/HTTP2PipelineHelpers.swift index cd14c5db..5d1b5cc2 100644 --- a/Sources/NIOHTTP2/HTTP2PipelineHelpers.swift +++ b/Sources/NIOHTTP2/HTTP2PipelineHelpers.swift @@ -296,6 +296,8 @@ extension Channel { position: ChannelPipeline.Position = .last, streamInboundType: StreamInbound.Type, streamOutboundType: StreamOutbound.Type, + inboundStreamBackpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, + isInboundStreamOutboundHalfClosureEnabled: Bool = false, inboundStreamInitializer: @escaping NIOHTTP2Handler.StreamInitializer ) throws -> EventLoopFuture>> { if self.eventLoop.inEventLoop { @@ -308,6 +310,8 @@ extension Channel { position: position, streamInboundType: streamInboundType, streamOutboundType: streamOutboundType, + inboundStreamBackpressureStrategy: inboundStreamBackpressureStrategy, + isInboundStreamOutboundHalfClosureEnabled: isInboundStreamOutboundHalfClosureEnabled, inboundStreamInitializer: inboundStreamInitializer ) } @@ -321,6 +325,8 @@ extension Channel { position: position, streamInboundType: streamInboundType, streamOutboundType: streamOutboundType, + inboundStreamBackpressureStrategy: inboundStreamBackpressureStrategy, + isInboundStreamOutboundHalfClosureEnabled: isInboundStreamOutboundHalfClosureEnabled, inboundStreamInitializer: inboundStreamInitializer ) } @@ -529,8 +535,12 @@ extension Channel { streamDelegate: NIOHTTP2StreamDelegate? = nil, connectionInboundType: ConnectionInbound.Type, connectionOutboundType: ConnectionOutbound.Type, + connectionBackpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, + connectionIsOutboundHalfClosureEnabled: Bool = false, streamInboundType: StreamInbound.Type, streamOutboundType: StreamOutbound.Type, + inboundStreamBackpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, + isInboundStreamOutboundHalfClosureEnabled: Bool = false, connectionInitializer: @escaping NIOHTTP2Handler.ConnectionInitializer, inboundStreamInitializer: @escaping NIOHTTP2Handler.StreamInitializer ) throws -> EventLoopFuture<( @@ -544,11 +554,15 @@ extension Channel { streamDelegate: streamDelegate, streamInboundType: streamInboundType, streamOutboundType: streamOutboundType, + inboundStreamBackpressureStrategy: inboundStreamBackpressureStrategy, + isInboundStreamOutboundHalfClosureEnabled: isInboundStreamOutboundHalfClosureEnabled, inboundStreamInitializer: inboundStreamInitializer ).flatMap { multiplexer in return connectionInitializer(self).flatMapThrowing { _ in let connectionAsyncChannel = try NIOAsyncChannel( synchronouslyWrapping: self, + backpressureStrategy: connectionBackpressureStrategy, + isOutboundHalfClosureEnabled: connectionIsOutboundHalfClosureEnabled, inboundType: ConnectionInbound.self, outboundType: ConnectionOutbound.self ) @@ -680,6 +694,8 @@ extension ChannelPipeline.SynchronousOperations { position: ChannelPipeline.Position = .last, streamInboundType: StreamInbound.Type, streamOutboundType: StreamOutbound.Type, + inboundStreamBackpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, + isInboundStreamOutboundHalfClosureEnabled: Bool = false, inboundStreamInitializer: @escaping NIOHTTP2Handler.StreamInitializer ) throws -> NIOHTTP2Handler.AsyncStreamMultiplexer> { return try self.configureAsyncHTTP2Pipeline( From 5d1584d3633b5afc776087063371f2ee2bf6acea Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Tue, 4 Jul 2023 13:16:04 +0100 Subject: [PATCH 2/4] review comments, re-order parameters --- ...annelHandler+InlineStreamMultiplexer.swift | 4 +-- Sources/NIOHTTP2/HTTP2PipelineHelpers.swift | 28 ++++++++++--------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Sources/NIOHTTP2/HTTP2ChannelHandler+InlineStreamMultiplexer.swift b/Sources/NIOHTTP2/HTTP2ChannelHandler+InlineStreamMultiplexer.swift index 4b3204ba..35c342e4 100644 --- a/Sources/NIOHTTP2/HTTP2ChannelHandler+InlineStreamMultiplexer.swift +++ b/Sources/NIOHTTP2/HTTP2ChannelHandler+InlineStreamMultiplexer.swift @@ -258,10 +258,10 @@ extension NIOHTTP2Handler { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @_spi(AsyncChannel) public func createStreamChannel( - backpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, - isOutboundHalfClosureEnabled: Bool = false, inboundType: Inbound.Type, outboundType: Outbound.Type, + backpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, + isOutboundHalfClosureEnabled: Bool = false, initializer: @escaping NIOHTTP2Handler.StreamInitializer ) async throws -> NIOAsyncChannel { return try await self.createStreamChannel { channel in diff --git a/Sources/NIOHTTP2/HTTP2PipelineHelpers.swift b/Sources/NIOHTTP2/HTTP2PipelineHelpers.swift index 5d1b5cc2..9033acb5 100644 --- a/Sources/NIOHTTP2/HTTP2PipelineHelpers.swift +++ b/Sources/NIOHTTP2/HTTP2PipelineHelpers.swift @@ -292,10 +292,10 @@ extension Channel { mode: NIOHTTP2Handler.ParserMode, connectionConfiguration: NIOHTTP2Handler.ConnectionConfiguration, streamConfiguration: NIOHTTP2Handler.StreamConfiguration, - streamDelegate: NIOHTTP2StreamDelegate? = nil, - position: ChannelPipeline.Position = .last, streamInboundType: StreamInbound.Type, streamOutboundType: StreamOutbound.Type, + streamDelegate: NIOHTTP2StreamDelegate? = nil, + position: ChannelPipeline.Position = .last, inboundStreamBackpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, isInboundStreamOutboundHalfClosureEnabled: Bool = false, inboundStreamInitializer: @escaping NIOHTTP2Handler.StreamInitializer @@ -306,10 +306,10 @@ extension Channel { mode: mode, connectionConfiguration: connectionConfiguration, streamConfiguration: streamConfiguration, - streamDelegate: streamDelegate, - position: position, streamInboundType: streamInboundType, streamOutboundType: streamOutboundType, + streamDelegate: streamDelegate, + position: position, inboundStreamBackpressureStrategy: inboundStreamBackpressureStrategy, isInboundStreamOutboundHalfClosureEnabled: isInboundStreamOutboundHalfClosureEnabled, inboundStreamInitializer: inboundStreamInitializer @@ -321,10 +321,10 @@ extension Channel { mode: mode, connectionConfiguration: connectionConfiguration, streamConfiguration: streamConfiguration, - streamDelegate: streamDelegate, - position: position, streamInboundType: streamInboundType, streamOutboundType: streamOutboundType, + streamDelegate: streamDelegate, + position: position, inboundStreamBackpressureStrategy: inboundStreamBackpressureStrategy, isInboundStreamOutboundHalfClosureEnabled: isInboundStreamOutboundHalfClosureEnabled, inboundStreamInitializer: inboundStreamInitializer @@ -532,13 +532,13 @@ extension Channel { mode: NIOHTTP2Handler.ParserMode, connectionConfiguration: NIOHTTP2Handler.ConnectionConfiguration, streamConfiguration: NIOHTTP2Handler.StreamConfiguration, - streamDelegate: NIOHTTP2StreamDelegate? = nil, connectionInboundType: ConnectionInbound.Type, connectionOutboundType: ConnectionOutbound.Type, - connectionBackpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, - connectionIsOutboundHalfClosureEnabled: Bool = false, streamInboundType: StreamInbound.Type, streamOutboundType: StreamOutbound.Type, + streamDelegate: NIOHTTP2StreamDelegate? = nil, + connectionBackpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, + isConnectionOutboundHalfClosureEnabled: Bool = false, inboundStreamBackpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, isInboundStreamOutboundHalfClosureEnabled: Bool = false, connectionInitializer: @escaping NIOHTTP2Handler.ConnectionInitializer, @@ -551,9 +551,9 @@ extension Channel { mode: mode, connectionConfiguration: connectionConfiguration, streamConfiguration: streamConfiguration, - streamDelegate: streamDelegate, streamInboundType: streamInboundType, streamOutboundType: streamOutboundType, + streamDelegate: streamDelegate, inboundStreamBackpressureStrategy: inboundStreamBackpressureStrategy, isInboundStreamOutboundHalfClosureEnabled: isInboundStreamOutboundHalfClosureEnabled, inboundStreamInitializer: inboundStreamInitializer @@ -562,7 +562,7 @@ extension Channel { let connectionAsyncChannel = try NIOAsyncChannel( synchronouslyWrapping: self, backpressureStrategy: connectionBackpressureStrategy, - isOutboundHalfClosureEnabled: connectionIsOutboundHalfClosureEnabled, + isOutboundHalfClosureEnabled: isConnectionOutboundHalfClosureEnabled, inboundType: ConnectionInbound.self, outboundType: ConnectionOutbound.self ) @@ -690,10 +690,10 @@ extension ChannelPipeline.SynchronousOperations { mode: NIOHTTP2Handler.ParserMode, connectionConfiguration: NIOHTTP2Handler.ConnectionConfiguration, streamConfiguration: NIOHTTP2Handler.StreamConfiguration, - streamDelegate: NIOHTTP2StreamDelegate? = nil, - position: ChannelPipeline.Position = .last, streamInboundType: StreamInbound.Type, streamOutboundType: StreamOutbound.Type, + streamDelegate: NIOHTTP2StreamDelegate? = nil, + position: ChannelPipeline.Position = .last, inboundStreamBackpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, isInboundStreamOutboundHalfClosureEnabled: Bool = false, inboundStreamInitializer: @escaping NIOHTTP2Handler.StreamInitializer @@ -708,6 +708,8 @@ extension ChannelPipeline.SynchronousOperations { inboundStreamInitializer(channel).flatMapThrowing { _ in return try NIOAsyncChannel( synchronouslyWrapping: channel, + backpressureStrategy: inboundStreamBackpressureStrategy, + isOutboundHalfClosureEnabled: isInboundStreamOutboundHalfClosureEnabled, inboundType: StreamInbound.self, outboundType: StreamOutbound.self ) From baa25d58cecd713c5549842124a8b40764d63b95 Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Tue, 4 Jul 2023 14:46:34 +0100 Subject: [PATCH 3/4] review comments --- ...annelHandler+InlineStreamMultiplexer.swift | 4 +-- Sources/NIOHTTP2/HTTP2PipelineHelpers.swift | 36 +++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/Sources/NIOHTTP2/HTTP2ChannelHandler+InlineStreamMultiplexer.swift b/Sources/NIOHTTP2/HTTP2ChannelHandler+InlineStreamMultiplexer.swift index 35c342e4..aa4a181f 100644 --- a/Sources/NIOHTTP2/HTTP2ChannelHandler+InlineStreamMultiplexer.swift +++ b/Sources/NIOHTTP2/HTTP2ChannelHandler+InlineStreamMultiplexer.swift @@ -258,8 +258,8 @@ extension NIOHTTP2Handler { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @_spi(AsyncChannel) public func createStreamChannel( - inboundType: Inbound.Type, - outboundType: Outbound.Type, + inboundType: Inbound.Type = Inbound.self, + outboundType: Outbound.Type = Inbound.self, backpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, isOutboundHalfClosureEnabled: Bool = false, initializer: @escaping NIOHTTP2Handler.StreamInitializer diff --git a/Sources/NIOHTTP2/HTTP2PipelineHelpers.swift b/Sources/NIOHTTP2/HTTP2PipelineHelpers.swift index 9033acb5..e61a7840 100644 --- a/Sources/NIOHTTP2/HTTP2PipelineHelpers.swift +++ b/Sources/NIOHTTP2/HTTP2PipelineHelpers.swift @@ -276,6 +276,8 @@ extension Channel { /// - streamConfiguration: The settings that will be used when establishing new streams. These mainly pertain to flow control. /// - streamDelegate: The delegate to be notified in the event of stream creation and close. /// - position: The position in the pipeline into which to insert the `NIOHTTP2Handler`. + /// - inboundStreamBackpressureStrategy: The backpressure strategy of the ``NIOAsyncChannel``s wrapping inbound HTTP/2 streams. + /// - isInboundStreamOutboundHalfClosureEnabled: If outbound half closure should be enabled for the ``NIOAsyncChannel``s wrapping inbound HTTP/2 streams. /// - streamInboundType: The ``NIOAsyncChannel/inboundStream`` message type for inbound stream channels. /// This type must match the `InboundOut` type of the final handler added to the stream channel by the `inboundStreamInitializer` /// or ``HTTP2Frame/FramePayload`` if there are none. @@ -292,12 +294,12 @@ extension Channel { mode: NIOHTTP2Handler.ParserMode, connectionConfiguration: NIOHTTP2Handler.ConnectionConfiguration, streamConfiguration: NIOHTTP2Handler.StreamConfiguration, - streamInboundType: StreamInbound.Type, - streamOutboundType: StreamOutbound.Type, streamDelegate: NIOHTTP2StreamDelegate? = nil, position: ChannelPipeline.Position = .last, inboundStreamBackpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, isInboundStreamOutboundHalfClosureEnabled: Bool = false, + streamInboundType: StreamInbound.Type = StreamInbound.self, + streamOutboundType: StreamOutbound.Type = StreamOutbound.self, inboundStreamInitializer: @escaping NIOHTTP2Handler.StreamInitializer ) throws -> EventLoopFuture>> { if self.eventLoop.inEventLoop { @@ -306,12 +308,12 @@ extension Channel { mode: mode, connectionConfiguration: connectionConfiguration, streamConfiguration: streamConfiguration, - streamInboundType: streamInboundType, - streamOutboundType: streamOutboundType, streamDelegate: streamDelegate, position: position, inboundStreamBackpressureStrategy: inboundStreamBackpressureStrategy, isInboundStreamOutboundHalfClosureEnabled: isInboundStreamOutboundHalfClosureEnabled, + streamInboundType: streamInboundType, + streamOutboundType: streamOutboundType, inboundStreamInitializer: inboundStreamInitializer ) } @@ -321,12 +323,12 @@ extension Channel { mode: mode, connectionConfiguration: connectionConfiguration, streamConfiguration: streamConfiguration, - streamInboundType: streamInboundType, - streamOutboundType: streamOutboundType, streamDelegate: streamDelegate, position: position, inboundStreamBackpressureStrategy: inboundStreamBackpressureStrategy, isInboundStreamOutboundHalfClosureEnabled: isInboundStreamOutboundHalfClosureEnabled, + streamInboundType: streamInboundType, + streamOutboundType: streamOutboundType, inboundStreamInitializer: inboundStreamInitializer ) } @@ -511,10 +513,14 @@ extension Channel { /// - streamConfiguration: The settings that will be used when establishing new streams. These mainly pertain to flow control. /// - streamDelegate: The delegate to be notified in the event of stream creation and close. /// - position: The position in the pipeline into which to insert the `NIOHTTP2Handler`. + /// - connectionBackpressureStrategy: The backpressure strategy of the ``NIOAsyncChannel`` wrapping the HTTP/2 connection channel. + /// - isConnectionOutboundHalfClosureEnabled: If outbound half closure should be enabled for the ``NIOAsyncChannel`` wrapping the HTTP/2 connection channel. /// - connectionInboundType: The ``NIOAsyncChannel/inboundStream`` message type for the HTTP/2 connection channel. /// This type must match the `InboundOut` type of the final handler in the connection channel. /// - connectionOutboundType: The ``NIOAsyncChannel/outboundWriter`` message type for the HTTP/2 connection channel. /// This type must match the `OutboundIn` type of the final handler in the connection channel. + /// - inboundStreamBackpressureStrategy: The backpressure strategy of the ``NIOAsyncChannel``s wrapping inbound HTTP/2 streams. + /// - isInboundStreamOutboundHalfClosureEnabled: If outbound half closure should be enabled for the ``NIOAsyncChannel``s wrapping inbound HTTP/2 streams. /// - streamInboundType: The ``NIOAsyncChannel/inboundStream`` message type for inbound stream channels. /// This type must match the `InboundOut` type of the final handler added to the stream channel by the `inboundStreamInitializer` /// or ``HTTP2Frame/FramePayload`` if there are none. @@ -532,15 +538,15 @@ extension Channel { mode: NIOHTTP2Handler.ParserMode, connectionConfiguration: NIOHTTP2Handler.ConnectionConfiguration, streamConfiguration: NIOHTTP2Handler.StreamConfiguration, - connectionInboundType: ConnectionInbound.Type, - connectionOutboundType: ConnectionOutbound.Type, - streamInboundType: StreamInbound.Type, - streamOutboundType: StreamOutbound.Type, streamDelegate: NIOHTTP2StreamDelegate? = nil, connectionBackpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, isConnectionOutboundHalfClosureEnabled: Bool = false, + connectionInboundType: ConnectionInbound.Type = ConnectionInbound.self, + connectionOutboundType: ConnectionOutbound.Type = ConnectionOutbound.self, inboundStreamBackpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, isInboundStreamOutboundHalfClosureEnabled: Bool = false, + streamInboundType: StreamInbound.Type = StreamInbound.self, + streamOutboundType: StreamOutbound.Type = StreamOutbound.self, connectionInitializer: @escaping NIOHTTP2Handler.ConnectionInitializer, inboundStreamInitializer: @escaping NIOHTTP2Handler.StreamInitializer ) throws -> EventLoopFuture<( @@ -551,11 +557,11 @@ extension Channel { mode: mode, connectionConfiguration: connectionConfiguration, streamConfiguration: streamConfiguration, - streamInboundType: streamInboundType, - streamOutboundType: streamOutboundType, streamDelegate: streamDelegate, inboundStreamBackpressureStrategy: inboundStreamBackpressureStrategy, isInboundStreamOutboundHalfClosureEnabled: isInboundStreamOutboundHalfClosureEnabled, + streamInboundType: streamInboundType, + streamOutboundType: streamOutboundType, inboundStreamInitializer: inboundStreamInitializer ).flatMap { multiplexer in return connectionInitializer(self).flatMapThrowing { _ in @@ -674,6 +680,8 @@ extension ChannelPipeline.SynchronousOperations { /// - streamConfiguration: The settings that will be used when establishing new streams. These mainly pertain to flow control. /// - streamDelegate: The delegate to be notified in the event of stream creation and close. /// - position: The position in the pipeline into which to insert the `NIOHTTP2Handler`. + /// - inboundStreamBackpressureStrategy: The backpressure strategy of the ``NIOAsyncChannel``s wrapping inbound HTTP/2 streams. + /// - isInboundStreamOutboundHalfClosureEnabled: If outbound half closure should be enabled for the ``NIOAsyncChannel``s wrapping inbound HTTP/2 streams. /// - streamInboundType: The ``NIOAsyncChannel/inboundStream`` message type for inbound stream channels. /// This type must match the `InboundOut` type of the final handler added to the stream channel by the `inboundStreamInitializer` /// or ``HTTP2Frame/FramePayload`` if there are none. @@ -690,12 +698,12 @@ extension ChannelPipeline.SynchronousOperations { mode: NIOHTTP2Handler.ParserMode, connectionConfiguration: NIOHTTP2Handler.ConnectionConfiguration, streamConfiguration: NIOHTTP2Handler.StreamConfiguration, - streamInboundType: StreamInbound.Type, - streamOutboundType: StreamOutbound.Type, streamDelegate: NIOHTTP2StreamDelegate? = nil, position: ChannelPipeline.Position = .last, inboundStreamBackpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, isInboundStreamOutboundHalfClosureEnabled: Bool = false, + streamInboundType: StreamInbound.Type = StreamInbound.self, + streamOutboundType: StreamOutbound.Type = StreamOutbound.self, inboundStreamInitializer: @escaping NIOHTTP2Handler.StreamInitializer ) throws -> NIOHTTP2Handler.AsyncStreamMultiplexer> { return try self.configureAsyncHTTP2Pipeline( From 49eb2f94300d0c68d36368f2521de041729bbddc Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Tue, 4 Jul 2023 15:10:13 +0100 Subject: [PATCH 4/4] param reordering, missing docs comments --- .../HTTP2ChannelHandler+InlineStreamMultiplexer.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/NIOHTTP2/HTTP2ChannelHandler+InlineStreamMultiplexer.swift b/Sources/NIOHTTP2/HTTP2ChannelHandler+InlineStreamMultiplexer.swift index aa4a181f..65fc442b 100644 --- a/Sources/NIOHTTP2/HTTP2ChannelHandler+InlineStreamMultiplexer.swift +++ b/Sources/NIOHTTP2/HTTP2ChannelHandler+InlineStreamMultiplexer.swift @@ -247,6 +247,8 @@ extension NIOHTTP2Handler { /// Create a stream channel initialized with the provided closure and return it wrapped within a `NIOAsyncChannel`. /// /// - Parameters: + /// - backpressureStrategy: The backpressure strategy of the ``NIOAsyncChannel`` wrapping the HTTP/2 stream channel. + /// - isOutboundHalfClosureEnabled: If outbound half closure should be enabled for the ``NIOAsyncChannel`` wrapping the HTTP/2 stream channel. /// - inboundType: The ``NIOAsyncChannel/inboundStream`` message type for the created channel. /// This type must match the `InboundOut` type of the final handler added to the stream channel by the `initializer` /// or ``HTTP2Frame/FramePayload`` if there are none. @@ -258,10 +260,10 @@ extension NIOHTTP2Handler { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @_spi(AsyncChannel) public func createStreamChannel( - inboundType: Inbound.Type = Inbound.self, - outboundType: Outbound.Type = Inbound.self, backpressureStrategy: NIOAsyncSequenceProducerBackPressureStrategies.HighLowWatermark? = nil, isOutboundHalfClosureEnabled: Bool = false, + inboundType: Inbound.Type = Inbound.self, + outboundType: Outbound.Type = Outbound.self, initializer: @escaping NIOHTTP2Handler.StreamInitializer ) async throws -> NIOAsyncChannel { return try await self.createStreamChannel { channel in