diff --git a/Package.swift b/Package.swift index 04ab9f9..7d654dc 100644 --- a/Package.swift +++ b/Package.swift @@ -229,9 +229,7 @@ var targets: [PackageDescription.Target] = [ .product(name: "HTTPTypes", package: "swift-http-types"), .product(name: "Algorithms", package: "swift-algorithms"), ], - swiftSettings: [ - .enableExperimentalFeature("StrictConcurrency") - ] + swiftSettings: strictConcurrencySettings ), .testTarget( name: "NIOHTTPResponsivenessTests", @@ -242,9 +240,7 @@ var targets: [PackageDescription.Target] = [ .product(name: "NIOEmbedded", package: "swift-nio"), .product(name: "HTTPTypes", package: "swift-http-types"), ], - swiftSettings: [ - .enableExperimentalFeature("StrictConcurrency") - ] + swiftSettings: strictConcurrencySettings ), ] diff --git a/Sources/NIOHTTPResponsiveness/HTTPDrippingDownloadHandler.swift b/Sources/NIOHTTPResponsiveness/HTTPDrippingDownloadHandler.swift index 76588e5..e466808 100644 --- a/Sources/NIOHTTPResponsiveness/HTTPDrippingDownloadHandler.swift +++ b/Sources/NIOHTTPResponsiveness/HTTPDrippingDownloadHandler.swift @@ -253,3 +253,6 @@ public final class HTTPDrippingDownloadHandler: ChannelDuplexHandler { } } } + +@available(*, unavailable) +extension HTTPDrippingDownloadHandler: Sendable {} diff --git a/Sources/NIOHTTPResponsiveness/HTTPReceiveDiscardHandler.swift b/Sources/NIOHTTPResponsiveness/HTTPReceiveDiscardHandler.swift index 8fba40d..5fea3cd 100644 --- a/Sources/NIOHTTPResponsiveness/HTTPReceiveDiscardHandler.swift +++ b/Sources/NIOHTTPResponsiveness/HTTPReceiveDiscardHandler.swift @@ -88,3 +88,6 @@ public final class HTTPReceiveDiscardHandler: ChannelInboundHandler { context.writeAndFlush(self.wrapOutboundOut(.end(nil)), promise: nil) } } + +@available(*, unavailable) +extension HTTPReceiveDiscardHandler: Sendable {} diff --git a/Sources/NIOHTTPResponsiveness/SimpleResponsivenessRequestMux.swift b/Sources/NIOHTTPResponsiveness/SimpleResponsivenessRequestMux.swift index 6cc1ff2..7ccd499 100644 --- a/Sources/NIOHTTPResponsiveness/SimpleResponsivenessRequestMux.swift +++ b/Sources/NIOHTTPResponsiveness/SimpleResponsivenessRequestMux.swift @@ -143,3 +143,6 @@ public final class SimpleResponsivenessRequestMux: ChannelInboundHandler { context.writeAndFlush(self.wrapOutboundOut(.end(nil)), promise: nil) } } + +@available(*, unavailable) +extension SimpleResponsivenessRequestMux: Sendable {} diff --git a/Sources/NIOResumableUploadDemo/main.swift b/Sources/NIOResumableUploadDemo/main.swift index 25373cc..b335e95 100644 --- a/Sources/NIOResumableUploadDemo/main.swift +++ b/Sources/NIOResumableUploadDemo/main.swift @@ -101,9 +101,11 @@ if #available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *) { let group = MultiThreadedEventLoopGroup(numberOfThreads: System.coreCount) let server = try ServerBootstrap(group: group).childChannelInitializer { channel in - channel.pipeline.configureHTTPServerPipeline().flatMap { - channel.pipeline.addHandlers([ - HTTP1ToHTTPServerCodec(secure: false), + channel.eventLoop.makeCompletedFuture { + let sync = channel.pipeline.syncOperations + try sync.configureHTTPServerPipeline() + try sync.addHandler(HTTP1ToHTTPServerCodec(secure: false)) + try sync.addHandler( HTTPResumableUploadHandler( context: uploadContext, handlers: [ @@ -111,8 +113,8 @@ if #available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *) { directory: URL(fileURLWithPath: CommandLine.arguments[1], isDirectory: true) ) ] - ), - ]) + ) + ) } } .bind(host: "0.0.0.0", port: 8080)