-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add concurrency annotations to fix strict compilation warnings #155
Conversation
@eseay this is ready for your review |
Updates the docs to correspond to the changes being made for Swift concurrency in connectrpc/connect-swift#155.
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.
@rebello95 everything looks great! Honestly, despite the shear number of changes, the changes themselves are relatively straightforward.
One suggestion -
It may be helpful to clients implementing the library to provide a bit of guidance around how we are addressing making closures @Sendable
in situations where you're wanting to update some kind of external state, but you need to do so in a thread-safe 'sendable' manner.
I know we want to keep Locked
as internal as we can, but perhaps we can point to it as an example of how one can implement such a type themselves as well as an example of how we're using it in unit tests.
Thanks for the review, @eseay.
Hmm, I don't think this is a pattern that's unique to Connect though (I believe it's pretty common when using closures with |
You're definitely right in that it's not unique to Connect. I was more just thinking that it could be helpful for someone integrating Connect into an existing project where widespread familiarity with Maybe we could add another example in the README that reflects one of the unit tests you've written where we're employing |
Ah okay, that makes sense @eseay. I think that should probably live here, though: https://connectrpc.com/docs/swift/testing#using-generated-mocks Is that okay with you? If so I can put a PR up for that. Would also appreciate another look at this PR - I pushed some changes per our offline conversation about allowing mocks to be |
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.
@rebello95 LGTM!
Updates the docs to correspond to the changes being made for Swift concurrency in connectrpc/connect-swift#155.
Updates the docs to correspond to the changes being made for Swift concurrency in connectrpc/connect-swift#155.
This contains fixes for warnings that appear by enabling Swift strict concurrency in the Xcode 15 beta: