소스 검색

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