Joe_Groff
(Joe Groff)
November 30, 2018, 3:59am
4
Yeah, since that initial proposal, we identified the need to be able to associate context with a coroutine. See this follow up thread:
The coroutine proposal as it stands essentially exposes raw delimited continuations. While this is a flexible and expressive feature in the abstract, for the concrete purpose of representing asynchronous coroutines, it provides weak user-level guarantees about where their code might be running after being resumed from suspension, and puts a lot of pressure on APIs to be well-behaved in this respect. And if we're building toward actors, where async actor methods should be guaranteed to run "in th…
As for cancellation, I like the model described by Nathaniel Smith in this blog post:
https://vorpus.org/blog/timeouts-and-cancellation-for-humans/
He lays out the problems with composing operations with cancellation contexts and has some interesting ideas about taking cancellation tokens and applying them in an easy-to-use scoped manner that doesn’t require much boilerplate.
8 Likes