File tree Expand file tree Collapse file tree 5 files changed +12
-5
lines changed Expand file tree Collapse file tree 5 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 1717import NIOCore
1818
1919#if compiler(>=5.6)
20- @ preconcurrency public typealias GRPCSendable = Swift . Sendable
20+ public typealias GRPCSendable = Swift . Sendable
2121#else
2222public typealias GRPCSendable = Any
2323#endif // compiler(>=5.6)
2424
25+ #if compiler(>=5.6)
26+ @preconcurrency
27+ public protocol GRPCPreconcurrencySendable : Sendable { }
28+ #else
29+ public protocol GRPCPreconcurrencySendable { }
30+ #endif // compiler(>=5.6)
31+
2532#if compiler(>=5.6)
2633@preconcurrency public typealias GRPCChannelInitializer = @Sendable ( Channel )
2734 -> EventLoopFuture < Void >
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ import Logging
2222/// The intended use of this protocol is with `ClientConnection`. In order to avoid retain
2323/// cycles, classes implementing this delegate **must not** maintain a strong reference to the
2424/// `ClientConnection`.
25- public protocol ClientErrorDelegate : AnyObject , GRPCSendable {
25+ public protocol ClientErrorDelegate : AnyObject , GRPCPreconcurrencySendable {
2626 /// Called when the client catches an error.
2727 ///
2828 /// - Parameters:
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public enum ConnectivityState: GRPCSendable {
4747 case shutdown
4848}
4949
50- public protocol ConnectivityStateDelegate : AnyObject , GRPCSendable {
50+ public protocol ConnectivityStateDelegate : AnyObject , GRPCPreconcurrencySendable {
5151 /// Called when a change in `ConnectivityState` has occurred.
5252 ///
5353 /// - Parameter oldState: The old connectivity state.
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import NIOCore
1717import NIOHTTP2
1818import SwiftProtobuf
1919
20- public protocol GRPCChannel : GRPCSendable {
20+ public protocol GRPCChannel : GRPCPreconcurrencySendable {
2121 /// Makes a gRPC call on the channel with requests and responses conforming to
2222 /// `SwiftProtobuf.Message`.
2323 ///
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import NIOHTTP2
1919import SwiftProtobuf
2020
2121/// A gRPC client.
22- public protocol GRPCClient : GRPCSendable {
22+ public protocol GRPCClient : GRPCPreconcurrencySendable {
2323 /// The gRPC channel over which RPCs are sent and received. Note that this is distinct
2424 /// from `NIO.Channel`.
2525 var channel : GRPCChannel { get }
You can’t perform that action at this time.
0 commit comments