Skip to content

Commit

Permalink
swift-format
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Nov 12, 2024
1 parent 4bbde85 commit bc8c387
Showing 1 changed file with 34 additions and 19 deletions.
53 changes: 34 additions & 19 deletions Sources/NIOHTTP2/HTTP2PipelineHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -698,10 +698,14 @@ extension Channel {
http1ConnectionInitializer: @escaping NIOChannelInitializerWithOutput<HTTP1ConnectionOutput>,
http2ConnectionInitializer: @escaping NIOChannelInitializerWithOutput<HTTP2ConnectionOutput>,
http2StreamInitializer: @escaping NIOChannelInitializerWithOutput<HTTP2StreamOutput>
) -> EventLoopFuture<EventLoopFuture<NIONegotiatedHTTPVersion<
HTTP1ConnectionOutput,
(HTTP2ConnectionOutput, NIOHTTP2Handler.AsyncStreamMultiplexer<HTTP2StreamOutput>)
>>> {
) -> EventLoopFuture<
EventLoopFuture<
NIONegotiatedHTTPVersion<
HTTP1ConnectionOutput,
(HTTP2ConnectionOutput, NIOHTTP2Handler.AsyncStreamMultiplexer<HTTP2StreamOutput>)
>
>
> {
self.configureAsyncHTTPServerPipeline(
streamDelegate: nil,
http2Configuration: http2Configuration,
Expand Down Expand Up @@ -733,28 +737,39 @@ extension Channel {
/// be waited on to retrieve the result of the negotiation.
@inlinable
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
public func configureAsyncHTTPServerPipeline<HTTP1ConnectionOutput: Sendable, HTTP2ConnectionOutput: Sendable, HTTP2StreamOutput: Sendable>(
public func configureAsyncHTTPServerPipeline<
HTTP1ConnectionOutput: Sendable,
HTTP2ConnectionOutput: Sendable,
HTTP2StreamOutput: Sendable
>(
streamDelegate: NIOHTTP2StreamDelegate?,
http2Configuration: NIOHTTP2Handler.Configuration = .init(),
http1ConnectionInitializer: @escaping NIOChannelInitializerWithOutput<HTTP1ConnectionOutput>,
http2ConnectionInitializer: @escaping NIOChannelInitializerWithOutput<HTTP2ConnectionOutput>,
http2StreamInitializer: @escaping NIOChannelInitializerWithOutput<HTTP2StreamOutput>
) -> EventLoopFuture<EventLoopFuture<NIONegotiatedHTTPVersion<
HTTP1ConnectionOutput,
(HTTP2ConnectionOutput, NIOHTTP2Handler.AsyncStreamMultiplexer<HTTP2StreamOutput>)
>>> {
let http2ConnectionInitializer: NIOChannelInitializerWithOutput<(HTTP2ConnectionOutput, NIOHTTP2Handler.AsyncStreamMultiplexer<HTTP2StreamOutput>)> = { channel in
channel.configureAsyncHTTP2Pipeline(
mode: .server,
streamDelegate: streamDelegate,
configuration: http2Configuration,
streamInitializer: http2StreamInitializer
).flatMap { multiplexer in
return http2ConnectionInitializer(channel).map { connectionChannel in
(connectionChannel, multiplexer)
) -> EventLoopFuture<
EventLoopFuture<
NIONegotiatedHTTPVersion<
HTTP1ConnectionOutput,
(HTTP2ConnectionOutput, NIOHTTP2Handler.AsyncStreamMultiplexer<HTTP2StreamOutput>)
>
>
> {
let http2ConnectionInitializer:
NIOChannelInitializerWithOutput<
(HTTP2ConnectionOutput, NIOHTTP2Handler.AsyncStreamMultiplexer<HTTP2StreamOutput>)
> = { channel in
channel.configureAsyncHTTP2Pipeline(
mode: .server,
streamDelegate: streamDelegate,
configuration: http2Configuration,
streamInitializer: http2StreamInitializer
).flatMap { multiplexer in
return http2ConnectionInitializer(channel).map { connectionChannel in
(connectionChannel, multiplexer)
}
}
}
}
let http1ConnectionInitializer: NIOChannelInitializerWithOutput<HTTP1ConnectionOutput> = { channel in
channel.pipeline.configureHTTPServerPipeline().flatMap { _ in
http1ConnectionInitializer(channel)
Expand Down

0 comments on commit bc8c387

Please sign in to comment.