-
Notifications
You must be signed in to change notification settings - Fork 56
support URLSession concurrency method in Swift 6(Linux, Windows) #58
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
Changes from 2 commits
5caa543
052257d
4b41fd0
1234104
03eab5b
d72a779
ae224e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ Package.resolved | |
|
||
# DocC generated files | ||
.docc-build | ||
DerivedData | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ private enum HTTPTypeConversionError: Error { | |
|
||
#endif | ||
|
||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) | ||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) || compiler(>=6) | ||
|
||
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) | ||
extension URLSession { | ||
|
@@ -113,7 +113,14 @@ extension URLSession { | |
} | ||
return (location, response) | ||
} | ||
} | ||
|
||
#endif | ||
|
||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we guard only the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I put it all together in one extension. |
||
|
||
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) | ||
extension URLSession { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AsyncBytes supports Apple Platform, but doesn't support Linux and Windows. |
||
/// Returns a byte stream that conforms to AsyncSequence protocol. | ||
/// | ||
/// - Parameter request: The `HTTPRequest` for which to load data. | ||
|
@@ -131,6 +138,10 @@ extension URLSession { | |
} | ||
} | ||
|
||
#endif | ||
|
||
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(visionOS) || compiler(>=6) | ||
|
||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) | ||
extension URLSession { | ||
/// Convenience method to load data using an `HTTPRequest`; creates and resumes a `URLSessionDataTask` internally. | ||
|
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.
Would you move it up to the Xcode section and delete one of the
.xcode
s?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 moved it under .xcode