Skip to content
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

Make HTTPMethod Sendable #3848

Merged
merged 1 commit into from
Mar 18, 2024
Merged

Make HTTPMethod Sendable #3848

merged 1 commit into from
Mar 18, 2024

Conversation

bestwnh
Copy link
Contributor

@bestwnh bestwnh commented Mar 18, 2024

Goals ⚽

Just like the #3816 but for HTTPMethod.
image

@jshier
Copy link
Contributor

jshier commented Mar 18, 2024

Thanks. I'll audit the other simple types.

@bestwnh
Copy link
Contributor Author

bestwnh commented Mar 18, 2024

@jshier Maybe it's time to begin the process to fully support concurrency? 👀

@jshier
Copy link
Contributor

jshier commented Mar 18, 2024

Full support is impossible until Apple's frameworks themselves fully support it, but Alamofire is generally thread-safe, even if it can't always provide Sendable conformances. For the most part I can add Sendable support to Alamofire's simple types, and I already declare such support as @unchecked for the Request types (which are manually thread-safe through locks and controlled queue usage), but complex types like AFError can't truly be Sendable until the various system types it captures are themselves Sendable. In the meantime, an audit of the simple public types should be possible.

@jshier jshier merged commit 9e9943f into Alamofire:master Mar 18, 2024
46 of 47 checks passed
@bestwnh
Copy link
Contributor Author

bestwnh commented Mar 18, 2024

Thanks for your explanation. I used to think that only UIKit is lack of concurrency support. Alamofire only use Foundation so I though it would be easier. I believe Alamofire is thread-safe. But I still want to kill all warning.

@jshier
Copy link
Contributor

jshier commented Mar 18, 2024

Sure. Feel free to report any others but remember, you can use @preconcurrency import Alamofire to silence them in general.

jshier added a commit that referenced this pull request Mar 31, 2024
### Goals ⚽
Similar to `HTTPMethod` in #3848, `HTTPHeaders` is trivially `Sendable`,
so add the conformance (and others).

### Implementation Details 🚧
Explicitly declared conformances.

### Testing Details 🔍
No additional tests, conformances are synthesized.
@jshier jshier added this to the 5.9.1 milestone Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants