All posts

Posts tagged with: Actors

5 posts found

A single rope cut cleanly with scissors, the two ends falling apart
Swift Swift Concurrency

Task.detached Isn't Task With Extra Steps. It Throws Away Everything Task Inherited For You.

Task.detached in Swift concurrency looks like a stronger version of Task, but it silently drops actor isolation, priority, and task-local values. Here's what actually breaks, and when detached is genuinely the right call.

5 min read
A velvet rope queue barrier stand, the kind used to control who enters one at a time
Swift Concurrency Actors

An Actor Isn't a Lock. It's a Line With a Very Specific Rule About Cutting.

Swift actors guarantee that only one task touches their state at a time — except across every await, where a second task can walk right in. Here's what actor reentrancy actually means and the bug pattern it causes.

7 min read
A close-up of an hourglass with sand mid-fall
Swift Concurrency

Your defer Didn't Fire Late. It Fired Exactly on Time — Just Not the Time You Meant

Swift's defer runs at the end of the enclosing scope, not the end of the function. Inside an if/else branch, that difference can silently defeat the cleanup you thought you wrote.

7 min read
An old padlock and key resting against weathered metal — the kind of lock you can see is doing something, unlike a token sitting quietly in RAM
Swift Keychain

The Actor That Refreshes Your Token Perfectly. It Also Forgets It on Relaunch.

AuthTokenStore solved the token-refresh race condition with a Swift actor. What it never solved is where the token lives between launches. Here's why an in-memory actor isn't secure storage, and what a Keychain-backed version actually costs you.

8 min read
A relay runner mid-sprint on an outdoor track, baton in hand, captured at full stride — the same shape as a request that has to keep moving forward through a dropped connection, an expired token, or a second caller asking for the same thing.
Swift Networking

Retry, Token Refresh, and Request Deduplication in Swift

Day 23 of the 30-day iOS series. The three production concerns every 'build your own networking layer' tutorial skips, built as composable actors on top of Day 22's client — plus a real concurrency bug I found writing the test, not the code.

13 min read