We've prepared another revision of the Structured Concurrency proposal. Here is the current revision:
Here was the revision at the time this thread was started: swift-evolution/nnnn-structured-concurrency.md at eb149799aac93b3fb84a97adb2bb3db47179a21b · DougGregor/swift-evolution · GitHub
Relative to the previous pitch, we've made the following further changes in response to feedback:
- Factored out the
async letsugar and the
with*ContinuationAPIs into their own proposals.
- Added discussion about where newly spawned child and detached tasks run, tying into the recent pitch about executors.
- Clarified the semantics of
withCancellationHandler, and added an example of its use (thanks to @jayton)
- Revised the static APIs on
Taskto be non-
async, so that they are also available to
non-async code when running on behalf of a task, as well as the ability to get
Taskinstances representing other tasks, and an
UnsafeCurrentTaskobject that can be used within the current task to access its state.
Task.Groupnow conforms to the
AsyncSequenceprotocol to allow
for awaitloops to iterate through the results of child tasks.
- Adopted the
@concurrentattribute for closures where appropriate in APIs like
Thanks for all of your ongoing feedback, everyone!