Async
Generated on 8/9/2024
4 searches
The concept of async/await in Swift is covered in several sessions at WWDC 2024. Here are some key points and relevant sessions:
-
A Swift Tour: Explore Swift’s features and design
- This session explains how Swift uses the
async
andawait
keywords to handle asynchronous operations. When a task is waiting for an asynchronous operation to complete, it suspends to yield the CPU to other tasks. This is demonstrated with an example of building a server using the Hummingbird framework. - Concurrency
- This session explains how Swift uses the
-
Migrate your app to Swift 6
- This session discusses how to handle shared mutable state and data races in Swift 6. It explains that calls to actor-isolated state are implicitly asynchronous and how to use
await
to access global variables on the main actor. - Shared mutable state in global instances and functions
- This session discusses how to handle shared mutable state and data races in Swift 6. It explains that calls to actor-isolated state are implicitly asynchronous and how to use
-
Go further with Swift Testing
- This session covers how to test asynchronous code in Swift. It mentions that for most completion handlers, Swift provides an async overload that can be used instead. If an async overload is not available, you can use
withCheckedContinuation
orwithCheckedThrowingContinuation
to convert it to an expression that can be awaited. - Asynchronous conditions
- This session covers how to test asynchronous code in Swift. It mentions that for most completion handlers, Swift provides an async overload that can be used instead. If an async overload is not available, you can use
-
Explore Swift performance
- This session delves into the performance aspects of async functions. It explains how async functions are split into multiple partial functions at runtime and how memory allocation works for async tasks.
- Async functions
These sessions provide a comprehensive overview of how async/await is implemented and used in Swift, along with practical examples and performance considerations.
Explore Swift performance
Discover how Swift balances abstraction and performance. Learn what elements of performance to consider and how the Swift optimizer affects them. Explore the different features of Swift and how they’re implemented to further understand the tradeoffs available that can impact performance.
Migrate your app to Swift 6
Experience Swift 6 migration in action as we update an existing sample app. Learn how to migrate incrementally, module by module, and how the compiler helps you identify code that’s at risk of data races. Discover different techniques for ensuring clear isolation boundaries and eliminating concurrent access to shared mutable state.
Go further with Swift Testing
Learn how to write a sweet set of (test) suites using Swift Testing’s baked-in features. Discover how to take the building blocks further and use them to help expand tests to cover more scenarios, organize your tests across different suites, and optimize your tests to run in parallel.
A Swift Tour: Explore Swift’s features and design
Learn the essential features and design philosophy of the Swift programming language. We’ll explore how to model data, handle errors, use protocols, write concurrent code, and more while building up a Swift package that has a library, an HTTP server, and a command line client. Whether you’re just beginning your Swift journey or have been with us from the start, this talk will help you get the most out of the language.