Explorar o código

Make request/response parts conditionally sendable (#1523)

Motivation:

The request/response parts are conditionally sendable based on their
request/response payload. They are not currently marked as such which
causes warnings in tests.

Modifications:

- Add conditional sendable conformance to request/response parts

Results:

Fewer warnings.
George Barnett %!s(int64=3) %!d(string=hai) anos
pai
achega
b1a5093641
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      Sources/GRPC/Interceptor/MessageParts.swift

+ 7 - 0
Sources/GRPC/Interceptor/MessageParts.swift

@@ -99,3 +99,10 @@ extension GRPCServerResponsePart {
     }
   }
 }
+
+#if swift(>=5.6)
+extension GRPCClientRequestPart: Sendable where Request: Sendable {}
+extension GRPCClientResponsePart: Sendable where Response: Sendable {}
+extension GRPCServerRequestPart: Sendable where Request: Sendable {}
+extension GRPCServerResponsePart: Sendable where Response: Sendable {}
+#endif