Skip to content

Fix sendability warnings in URLSessionHTTPClient #7441

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

Merged
merged 3 commits into from
Apr 9, 2024

Conversation

MaxDesiatov
Copy link
Contributor

@MaxDesiatov MaxDesiatov commented Apr 8, 2024

Converted DownloadTask and DataTask to value types and added more Sendable annotations where needed.

Achieved by converting `DownloadTask` and `DataTask` to value types and adding more `Sendable` annotations where needed.
@MaxDesiatov MaxDesiatov requested a review from xedin April 8, 2024 09:45
@MaxDesiatov MaxDesiatov self-assigned this Apr 8, 2024
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov MaxDesiatov enabled auto-merge (squash) April 8, 2024 09:45
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@@ -12,8 +12,6 @@

import Basics

import Build
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated warning, but probably not worth a separate one-liner PR, so chucking that in here instead.

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

@@ -312,7 +312,7 @@ extension LegacyHTTPClient {
headers: HTTPClientHeaders = .init(),
options: Request.Options = .init(),
observabilityScope: ObservabilityScope? = .none,
completion: @escaping (Result<Response, Error>) -> Void
completion: @Sendable @escaping (Result<Response, Error>) -> Void
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stylistic nit: I think the preferred ordering for function types is @escaping @Sendable

@MaxDesiatov MaxDesiatov merged commit 549d781 into main Apr 9, 2024
5 checks passed
@MaxDesiatov MaxDesiatov deleted the maxd/sendable-httpclient branch April 9, 2024 17:03
furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
Achieved by converting `DownloadTask` and `DataTask` to value types and adding more `Sendable` annotations where needed.
furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
Achieved by converting `DownloadTask` and `DataTask` to value types and adding more `Sendable` annotations where needed.
bnbarham pushed a commit to bnbarham/swift-package-manager that referenced this pull request May 18, 2024
Achieved by converting `DownloadTask` and `DataTask` to value types and adding more `Sendable` annotations where needed.

(cherry picked from commit 549d781)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants