Przeglądaj źródła

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 3 lat temu
rodzic
commit
b1a5093641
1 zmienionych plików z 7 dodań i 0 usunięć
  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