-
-
Notifications
You must be signed in to change notification settings - Fork 800
Async / Await #1079
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
Async / Await #1079
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
write, writeWithoutTransaction, barrierWriteWithoutTransaction, erase, vacuum, vacuum(into:)
migrate(_:) migrate(_:upTo:)
Also use .trackingConstantRegion since it triggers optimizations
This fixes the build for macOS 11.5
This file is designed to be copied into user apps: make sure the license comes along.
See https://forums.swift.org/t/52862 for a longer explanation. Fortunately, we can base @query on Combine publishers, which do not have this problem.
# Conflicts: # Documentation/DemoApps/GRDBDemoiOS/README.md # Documentation/DemoApps/README.md
Xcode 13.2 RC won't compile unless we make a Sendable copy of the row that could not be decoded.
Owner
Author
|
Xcode 13.2 RC is out, so we're close to a release! |
Xcode 13.1 won't have access to async apis. This simplifies our availability checks. The techniques were inspired from: - https://github.com/swift-server/guides/blob/main/docs/concurrency-adoption-guidelines.md#api-design - https://github.com/swift-server/guides/blob/main/docs/concurrency-adoption-guidelines.md#backwards-compatibility-of-declarations-and-checked-swift-concurrency
Xcode 12 won't accept those flags. And we only need them starting Xcode 13.2
I believe this is incorrect: FB9801372 (UIApplication.didReceiveMemoryWarningNotification should not be declared @mainactor) Meanwhile, just use the string version. A workaround based on a MainActor-isolated task can't work due to conflict between compiler version and minimum iOS target: #if compiler(>=5.5) && canImport(_Concurrency) if #available(...) { // Check for availability of concurrency runtime Task { @mainactor [weak self] in NotificationCenter.default.addObserver(..., name: UIApplication.didReceiveMemoryWarningNotification, object: nil) } } else { // IMPOSSIBLE CASE: No access to Task, no access to notification names } #else NotificationCenter.default.addObserver(..., name: UIApplication.didReceiveMemoryWarningNotification, object: nil) #endif
But async apis are still only exposed to Swift 5.5.2. Sendable conformances are helpful for users of Xcode < 13.2.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request brings support for Swift concurrency and async/await.
It implements the "Phase 1", as discussed in #1065, which means that the new async apis wrap the underlying DispatchQueue-based implementation.
All async apis are 🔥 EXPERIMENTAL.
📦 Also included in this PR
🚧 Remaining tasks
💝 WELCOMED CONTRIBUTIONS
I do not personally own a macOS computer able to run async/await. If you do, can you please check that the new apis are readily available, and report your findings? Thank you in advance.Monterey + M1 work fineCome discuss, or submit pull requests against the
dev/asyncbranch!cc @Nekitosss, @StuClift