Below is a small Swift program that adapts a callback API to async via withCheckedContinuation. The event source is fully synchronous and deterministic: all callback invocations happen within a single call to start() in a strictly defined order.
stdout.swift run
| separators and the result= prefix.TaskswithCheckedContinuation is used to complete a single async operation once within the same start() call stackClick a line and write what it prints. Explanation is optional.