Menu

1 / 3

Continuations in Practice: What SE-0564 Split Continuations Changes

DEV Community: ios·Dheerendra Chaturvedi·10 days ago
#cdkxKRJC
#devtoios#devto#dev#isolation#available
Long article (4923 words) — no AI summary yet.
Reading 0:00
15s threshold

Most iOS codebases still have callback APIs at their edges: an analytics SDK, a Bluetooth stack, a payment library, an old networking layer nobody wants to rewrite. Continuations are how those APIs become async functions. The conversion looks trivial, but it is the place I have seen the most subtle concurrency bugs: tasks that hang forever, crashes that only happen under load, and cancellation that silently does nothing.

This article covers how continuations behave in real code, the three classic bugs (double resume, missing resume, ignored cancellation) and how to fix each one with today's APIs. It then covers what SE-0564: Split continuations changes.

How the examples were checked:

Today's APIs ( CheckedContinuation , withTaskCancellationHandler , Mutex ): every example was compiled and tested with Swift 6.2.4 in Swift 6 language mode ( source on GitHub ). The test suite includes 400 runs that deliberately race a timeout against completion and cancellation against completion.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.