[swift-evolution] [Concurrency] async/await + actors
Kenny Leung
kenny_leung at pobox.com
Mon Sep 11 15:14:30 CDT 2017
I found a decent description about async/await here:
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/ <https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/>
So it’s much more like runloop based callbacks in Foundation that libdispatch. It’s complicated. Even the simplest example is super complicated.
It’s super implicit (like, “I’m going to package up every line of code from await to the end of this function and turn it into a continuation”). That seems to go against one of the primary principles of Swift, which is to make things plain to the reader. I’d be interested to know what the call stack looks like on the line after await.
The doc takes away some of the mystery, but leaves major questions, like: await is used to yield control to the parent, but at the bottom of the call stack, presumably you’re going to do something blocking, so how do you call await?
-Kenny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170911/cbaeb1b3/attachment.html>
More information about the swift-evolution
mailing list