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 Sendable support #19
Conversation
Conform internal models to Sendable. There are two classes which are unchecked Sendables and use an NSLock to manage access to the mutable values.
Bump. |
Hi, does it require Swift 5.6? |
@kean I believe 5.6 is required for the #if compiler(>=5.6)
@preconcurrency import Foundation
#else
import Foundation
#endif Edit: went ahead and made the change |
I would appreciate if you could do that. In the meantime, I'll learn about |
|
Making request, response, and configuration Sendable seem like a good idea. Unfortunately, it doesn't compile in Xcode 13.2 without |
I would only need to change the compiler version I think, I don't happen to have a copy of 13.2 on hand however. So maybe the compiler version needs to be set to 5.5 instead of 5.6. |
|
||
public struct Request<Response> { | ||
public struct Request<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.
I think this should be extension Response: Sendable where T: Sendable {}
. We should restrict the users to only using Sendable
types are responses.
@ericlewis, I made I'm not sure if anything else needs to be. I don't think Thanks for opening an MR and raising this topic. I'm going to close this PR. If you have any suggestions, I'm open to them. |
Sorry for only seeing this now - the reason that came up is because you can pass around api stuff through sendable boundaries. it should be somewhat safe to do so. but we get complaints. so making it safer was a good option. |
Tests pass locally. Of course, the alternative is that we could just
@preconcurrency import Get
, but.. going to need proper support anyway and the locking mechanisms fix potential data races that exist today.