-
Notifications
You must be signed in to change notification settings - Fork 434
Add Sendable conformance to various types #1334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Request: Sendable, | ||
Response: Sendable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have an explicit Request and Response here? Cant we say
where Deserializer.Output == Sendable, Serializer.Input == Sendable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, we can do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for one question this looks good to my eyes. However it might be good to get a second review on this as well.
Motivation: Sendable conformance is used to indicate that a type is thread-safe. Sendable checks are limited in 5.5 but will tighten in future Swift versions. Modifications: - Add `Sendable` conformance to a number of the new types added just for async/await - Add a `GRPCSendable` typealias to allow `Sendable` to be applied when it is available. This is used on the relevant types which existed before async/await support was added. Result: Wider Sendable conformance.
Okay, we can wait for @Lukasa to have a look -- no rush with this one tbh. |
Sadly the compiler is tripping over an assertion too: https://bugs.swift.org/browse/SR-15628 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Closing in favour of #1378 |
Motivation:
Sendable conformance is used to indicate that a type is thread-safe.
Sendable checks are limited in 5.5 but will tighten in future Swift
versions.
Modifications:
Sendable
conformance to a number of the new types added just forasync/await
GRPCSendable
typealias to allowSendable
to be applied whenit is available. This is used on the relevant types which existed
before async/await support was added.
Result:
Wider Sendable conformance.