2 ms·
Is this the same as the distinction between a model in which async functions "run synchronously to the first await" vs one in which they "always yield once befo
by pansa2 11mo ago
Is this the same as the distinction between a model in which async functions "run synchronously to the first await" vs one in which they "always yield once before executing", as discussed here?
https://www.reddit.com/r/rust/comments/8aaywk/async_await_in_rust_a_full_proposal/dwxjjo2/ https://www.reddit.com/r/rust/comments/8aaywk/async_await_in...
- dataflow 11mo agoI think there are at least two degrees of freedom being discussed here, though I'm quite unsure, so someone please correct me if I'm wrong: - What happens when MyCoroutine() is invoked (as an ordinary function invocation - no await etc.): does execution of the body start right then, or do you just get some sort of awaitable object that can be used to start it later? - What happens when the result of said invocation is awaited (using your language's await operator plus any extra function calls needed to begin execution): is there a forced yield to the scheduler at any point here, or do you directly start executing the body? The article seems to be treating the two as an indivisible pair, and thus discussing the behavior merely before and after the pair as a whole, but your link seems to be discussing the first? Again, I'm quite unsure, so curious if anyone has thoughts.