Modern Concurrency in Swift | Kodeco

[ad_1]

This section tells you a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book, and more.

Get to know the modern Swift concurrency model, then take a deep dive into async code by working on a real-time stock trading project.

Go into more detail about how the async/await syntax and the cooperative asynchronous execution work. Additionally, it introduces the usage of “async let” to design concurrent code and the “Task” type which encapsulates asynchronous execution in the modern concurrency model.

Work with async sequences in more detail, proxying Combine to async/await code and managing async tasks.

Create custom asynchronous sequences by leveraging AsyncStream, which lets you wrap existing asynchronous work in your app as an asynchronous sequence without breaking a sweat.

Learn about continuations, which are a way to manually manage suspended functions. You’ll use them to bridge between existing non-async/await code and modern, concurrent APIs.

Develop an asynchronous testing infrastructure and learn all the ins-and-outs of testing asynchronous code in the new concurrency model. You’ll wrap up by adding unit tests to the Blabber project you worked on in previous chapters.

Create dynamic concurrency with Task Groups, which let you run an arbitrary number of tasks concurrently and offers a natural sequence interface to access and iterate over the results of those tasks.

Actor is the new Swift type that transparently protects its mutable state from data races in a synchronized container, making concurrent programming much safer.

Now that you know actors, you’ll learn about a special subset of them — global actors, which allow easy and safe access to shared resources from anywhere in your app.

Create a distributed system that uses actors to execute concurrent tasks on multiple devices over the local network.

[ad_2]

Source link