瀏覽代碼

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 年之前
父節點
當前提交
b1a5093641
共有 1 個文件被更改,包括 7 次插入0 次删除
  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