Adopt `Sendable` in `Codec.swift` and `SingleStepByteToMessageDecoder.swift` (#2149)
Co-authored-by: Cory Benfield <lukasa@apple.com>
This commit is contained in:
parent
97a568ac61
commit
4574bdde82
|
@ -14,7 +14,7 @@
|
|||
|
||||
|
||||
/// State of the current decoding process.
|
||||
public enum DecodingState {
|
||||
public enum DecodingState: NIOSendable {
|
||||
/// Continue decoding.
|
||||
case `continue`
|
||||
|
||||
|
@ -485,6 +485,11 @@ public final class ByteToMessageHandler<Decoder: ByteToMessageDecoder> {
|
|||
}
|
||||
}
|
||||
|
||||
#if swift(>=5.7)
|
||||
@available(*, unavailable)
|
||||
extension ByteToMessageHandler: Sendable {}
|
||||
#endif
|
||||
|
||||
// MARK: ByteToMessageHandler: Test Helpers
|
||||
extension ByteToMessageHandler {
|
||||
internal var cumulationBuffer: ByteBuffer? {
|
||||
|
@ -771,6 +776,11 @@ public final class MessageToByteHandler<Encoder: MessageToByteEncoder>: ChannelO
|
|||
}
|
||||
}
|
||||
|
||||
#if swift(>=5.7)
|
||||
@available(*, unavailable)
|
||||
extension MessageToByteHandler: Sendable {}
|
||||
#endif
|
||||
|
||||
extension MessageToByteHandler {
|
||||
public func handlerAdded(context: ChannelHandlerContext) {
|
||||
precondition(self.state.readyToBeAddedToChannel,
|
||||
|
|
|
@ -274,6 +274,10 @@ public final class NIOSingleStepByteToMessageProcessor<Decoder: NIOSingleStepByt
|
|||
}
|
||||
}
|
||||
|
||||
#if swift(>=5.7)
|
||||
@available(*, unavailable)
|
||||
extension NIOSingleStepByteToMessageProcessor: Sendable {}
|
||||
#endif
|
||||
|
||||
// MARK: NIOSingleStepByteToMessageProcessor Public API
|
||||
extension NIOSingleStepByteToMessageProcessor {
|
||||
|
|
Loading…
Reference in New Issue