Skip to content

Commit

Permalink
Adopt Sendable in NIOHTTPCompression (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnadoba committed Aug 23, 2022
1 parent 9697a61 commit 1ef46c0
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/NIOHTTPCompression/HTTPCompression.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/NIOHTTPCompression/HTTPDecompression.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions Sources/NIOHTTPCompression/HTTPRequestCompressor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,7 @@ public final class NIOHTTPRequestCompressor: ChannelOutboundHandler, RemovableCh
}
}

#if swift(>=5.6)
@available(*, unavailable)
extension NIOHTTPRequestCompressor: Sendable {}
#endif
5 changes: 5 additions & 0 deletions Sources/NIOHTTPCompression/HTTPRequestDecompressor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,8 @@ public final class NIOHTTPRequestDecompressor: ChannelDuplexHandler, RemovableCh
}
}
}

#if swift(>=5.6)
@available(*, unavailable)
extension NIOHTTPRequestDecompressor: Sendable {}
#endif
6 changes: 6 additions & 0 deletions Sources/NIOHTTPCompression/HTTPResponseCompressor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
5 changes: 5 additions & 0 deletions Sources/NIOHTTPCompression/HTTPResponseDecompressor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,8 @@ public final class NIOHTTPResponseDecompressor: ChannelDuplexHandler, RemovableC
}
}
}

#if swift(>=5.6)
@available(*, unavailable)
extension NIOHTTPResponseDecompressor: Sendable {}
#endif

0 comments on commit 1ef46c0

Please sign in to comment.