I wanted async/await but I got a concurrency model

I remember the moment Swift announced async/await. I was genuinely relieved.
Finally, there was going to be a way out of completion handler pyramids, delegate chains, and the special kind of cognitive overhead that comes from reading code that executes in a completely different order than it is written.
I had worked with C# async/await years earlier, and my mental model came from there. In a UI app, if a SynchronizationContext is present, awaiting a Task captures it and posts the continuation back to it.

添加评论
点赞收藏
点踩分享查看原文
评论
?
参与讨论