Swift by Sundell cover image

99: “Structured concurrency”, with special guest Doug Gregor

Swift by Sundell

00:00

The Main Actor Pattern in Swift Type System

The main actor is a very special kind of actor. It's really modeling something that already exists in the system and that every app has had to contend with, which is this notion of the main thread. And so you can mark a particular function or a property as being on the main actor. You need to mark it with a weight and under the hood, the system is doing basically the equivalent of dispatch cue.main.async to go and make that call happen over on the mainthread.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app