Skip to content

Commit b1a5093

Browse files
authored
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.
1 parent 9df1f25 commit b1a5093

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sources/GRPC/Interceptor/MessageParts.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,10 @@ extension GRPCServerResponsePart {
9999
}
100100
}
101101
}
102+
103+
#if swift(>=5.6)
104+
extension GRPCClientRequestPart: Sendable where Request: Sendable {}
105+
extension GRPCClientResponsePart: Sendable where Response: Sendable {}
106+
extension GRPCServerRequestPart: Sendable where Request: Sendable {}
107+
extension GRPCServerResponsePart: Sendable where Response: Sendable {}
108+
#endif

0 commit comments

Comments
 (0)