mirror of
https://github.com/apple/swift-nio-extras.git
synced 2025-05-28 09:23:41 +08:00
Adopt Sendable
in NIOHTTPCompression
(#172)
This commit is contained in:
parent
9697a611c4
commit
1ef46c0352
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user