You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Releasing a TaskStore now cancels its running tasks. Tasks no longer keep the store alive, so keep a reference to the store for as long as its tasks should run.
addIsolatedTask and addImmediateTask operations must write self. explicitly (@_implicitSelfCapture was removed), so it's visible when a task keeps its owner alive.
TaskNameProvider is now a struct instead of a protocol, and the separate provider types and callAsFunction are gone
Use .keyDescription (no parentheses), .constant(_:), .fromKey { ... }, .withPrefix(_:) and .withIncrementingSuffix()
TaskStore has a single init(nameProvider:) that defaults to nil
.withIncrementingSuffix() leaves unnamed tasks unnamed instead of naming them with just a number
The preferPrevious, cancelPrevious, waitForPrevious and runNewTask instance properties on TaskStoreDuplicateKeyBehavior are no longer public.
Features
An operation whose task is cancelled before it starts no longer runs, for example when a task waiting under .wait or .cancelPrevious(wait: true) is replaced before its turn.
Bug Fixes
The documented name-provider syntax now compiles, e.g. TaskStore<Key>(nameProvider: .keyDescription.withPrefix("App")).
addIsolatedTask now always runs its operation on the caller's actor, including when called from a function that takes an isolated parameter.
Improvements
Documented the one-current-task-per-key model, how cancelling the current task also cancels the tasks it replaced, and that .preferPrevious returns the current task even after it was cancelled.
CI now runs on macOS 26 (Swift 6.2), and the release workflow runs the tests first.