1
0
mirror of https://github.com/apple/swift-nio-extras.git synced 2025-05-28 09:23:41 +08:00

Adopt Sendable in NIOHTTPCompression ()

This commit is contained in:
David Nadoba 2022-08-23 14:24:16 +02:00 committed by GitHub
parent 9697a611c4
commit 1ef46c0352
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 2 deletions

@ -19,7 +19,7 @@ import NIOCore
public enum NIOCompression {
/// Which algorithm should be used for compression.
public struct Algorithm: CustomStringConvertible, Equatable {
public struct Algorithm: CustomStringConvertible, Equatable, NIOSendable {
fileprivate enum AlgorithmEnum: String {
case gzip
case deflate

@ -18,7 +18,7 @@ import NIOCore
/// Namespace for decompression code.
public enum NIOHTTPDecompression {
/// Specifies how to limit decompression inflation.
public struct DecompressionLimit {
public struct DecompressionLimit: NIOSendable {
private enum Limit {
case none
case size(Int)

@ -179,3 +179,7 @@ public final class NIOHTTPRequestCompressor: ChannelOutboundHandler, RemovableCh
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension NIOHTTPRequestCompressor: Sendable {}
#endif

@ -89,3 +89,8 @@ public final class NIOHTTPRequestDecompressor: ChannelDuplexHandler, RemovableCh
}
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension NIOHTTPRequestDecompressor: Sendable {}
#endif

@ -221,6 +221,12 @@ public final class HTTPResponseCompressor: ChannelDuplexHandler, RemovableChanne
pendingWritePromise = context.eventLoop.makePromise()
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension HTTPResponseCompressor: Sendable {}
#endif
/// A buffer object that allows us to keep track of how much of a HTTP response we've seen before
/// a flush.
///

@ -105,3 +105,8 @@ public final class NIOHTTPResponseDecompressor: ChannelDuplexHandler, RemovableC
}
}
}
#if swift(>=5.6)
@available(*, unavailable)
extension NIOHTTPResponseDecompressor: Sendable {}
#endif