Beware of specifying isolation requirements for whole protocols

Matt Massicotte has a well-written, brief introduction to isolation in Swift. But it mostly just enumerates the state of things, without offering much guidance. One pitfall in particular is important to call out, regarding isolated protocols. These might seem pretty similar – you’d be forgiven for assuming it’s just a convenience to put @MainActor on… Read more

Performing a delayed and/or repeating operation in a Swift Actor

Say you want to perform some operation after a delay, and/or at regular intervals, inside a Swift actor – maybe your actor represents a weather station and you want to periodically fetch the latest weather information, automatically. How do you do that? You could punt the problem to some other code, outside the actor –… Read more