-
Notifications
You must be signed in to change notification settings - Fork 126
Make async/await available on older Apple Platforms #527
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
Conversation
97d9709
to
46e6805
Compare
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.
LGTM. @glbrntt do you mind giving this a look?
### Motivation Calling `HTTPClient.shutdown()` may never return if connections are still starting and one new established connection results in a state migration (i.e. from HTTP1 to HTTP2 or vice versa). We forgot to migrate the shutdown state. This could result in a large dealy until `.shutdown()` returns because we wait until connections are closed because of idle timeout. Worse, it could also never return if more requests are queued because the connections would not be idle and therefore not close itself. ###Changes - Mirgrate shutdown state too - add tests for this specific case
### Motivation With Xcode 13.2, and therefore Swift 5.5.2, Swift Concurrecy is supported on older Apple OSs. async/await suport will no longer be available on Swift before `5.5.2` but this isn't a breaking change because we have not yet made anything of it public. ### Changes - replace all `#if compiler(>=5.5) && canImport(_Concurrency)` with `#if compiler(>=5.5.2) && canImport(_Concurrency)` - replace all `available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)` with `available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)`
46e6805
to
8933da3
Compare
@@ -16,7 +16,7 @@ | |||
import NIOConcurrencyHelpers | |||
import NIOCore | |||
|
|||
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) | |||
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) |
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.
Only tests, but presumably the #if swift
above needs to be updated too?
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.
LGTM
Motivation
With Xcode 13.2, and therefore Swift 5.5.2, Swift Concurrency is supported on older Apple OSs. async/await support will no longer be available on Swift before
5.5.2
but this isn't a breaking change because we have not yet made anything of it public.Changes
#if compiler(>=5.5) && canImport(_Concurrency)
with#if compiler(>=5.5.2) && canImport(_Concurrency)
available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
withavailable(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)