diff --git a/Package.swift b/Package.swift index dd26310..04ab9f9 100644 --- a/Package.swift +++ b/Package.swift @@ -50,7 +50,8 @@ var targets: [PackageDescription.Target] = [ .product(name: "NIO", package: "swift-nio"), .product(name: "NIOCore", package: "swift-nio"), .product(name: "NIOHTTP1", package: "swift-nio"), - ] + ], + swiftSettings: strictConcurrencySettings ), .executableTarget( name: "HTTPServerWithQuiescingDemo", @@ -133,7 +134,8 @@ var targets: [PackageDescription.Target] = [ .product(name: "NIOEmbedded", package: "swift-nio"), .product(name: "NIOHTTP1", package: "swift-nio"), .product(name: "NIOConcurrencyHelpers", package: "swift-nio"), - ] + ], + swiftSettings: strictConcurrencySettings ), .testTarget( name: "NIOSOCKSTests", diff --git a/Sources/NIOHTTPCompression/HTTPCompression.swift b/Sources/NIOHTTPCompression/HTTPCompression.swift index 69ad36b..f696871 100644 --- a/Sources/NIOHTTPCompression/HTTPCompression.swift +++ b/Sources/NIOHTTPCompression/HTTPCompression.swift @@ -16,7 +16,7 @@ import CNIOExtrasZlib import NIOCore /// Namespace for compression code. -public enum NIOCompression { +public enum NIOCompression: Sendable { /// Which algorithm should be used for compression. public struct Algorithm: CustomStringConvertible, Equatable, Sendable { diff --git a/Sources/NIOHTTPCompression/HTTPDecompression.swift b/Sources/NIOHTTPCompression/HTTPDecompression.swift index 4ff0d44..3acc1c5 100644 --- a/Sources/NIOHTTPCompression/HTTPDecompression.swift +++ b/Sources/NIOHTTPCompression/HTTPDecompression.swift @@ -16,7 +16,7 @@ import CNIOExtrasZlib import NIOCore /// Namespace for decompression code. -public enum NIOHTTPDecompression { +public enum NIOHTTPDecompression: Sendable { /// Specifies how to limit decompression inflation. public struct DecompressionLimit: Sendable { private enum Limit { diff --git a/Tests/NIOHTTPCompressionTests/HTTPResponseCompressorTest.swift b/Tests/NIOHTTPCompressionTests/HTTPResponseCompressorTest.swift index 75f6713..0b6d0b0 100644 --- a/Tests/NIOHTTPCompressionTests/HTTPResponseCompressorTest.swift +++ b/Tests/NIOHTTPCompressionTests/HTTPResponseCompressorTest.swift @@ -40,7 +40,7 @@ private class PromiseOrderer { let thisPromiseIndex = promiseArray.count promiseArray.append(promise) - promise.futureResult.whenComplete { (_: Result) in + promise.futureResult.hop(to: self.eventLoop).assumeIsolated().whenComplete { (_: Result) in let priorFutures = self.promiseArray[0..