Skip to content

Commit

Permalink
adopt NIOAsyncChannel.Configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
rnro committed Jul 11, 2023
1 parent c6562c0 commit 97da616
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ extension NIOHTTP2Handler {
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
@_spi(AsyncChannel)
public func createStreamChannel<Inbound, Outbound>(
configuration: NIOAsyncChannel<Inbound, Outbound>.Configuration,
initializer: @escaping NIOHTTP2Handler.StreamInitializer
configuration: NIOAsyncChannel<Inbound, Outbound>.Configuration = .init(),
initializer: @escaping NIOChannelInitializer
) async throws -> NIOAsyncChannel<Inbound, Outbound> {
return try await self.createStreamChannel { channel in
initializer(channel).flatMapThrowing { _ in
Expand Down
6 changes: 6 additions & 0 deletions Sources/NIOHTTP2/HTTP2PipelineHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -804,3 +804,9 @@ public struct NIOHTTP2AsyncConfiguration<HTTP2ConnectionInbound: Sendable, HTTP2
self.inboundStreamInitializer = inboundStreamInitializer
}
}

#if swift(>=5.7)
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
@_spi(AsyncChannel)
extension NIOHTTP2AsyncConfiguration: @unchecked Sendable {}
#endif

0 comments on commit 97da616

Please sign in to comment.