2 ms·
It's actually the case that's marked async that surprises me more. But I don't think the difference has ever mattered in code that I've written or worked with.
by ziml77 5y ago
It's actually the case that's marked async that surprises me more. But I don't think the difference has ever mattered in code that I've written or worked with.
The reason that the non-async case makes sense to me is that I know there's usually going to be some synchronous code execution before the function I'm calling has to go async. And in that case I expect the code the executed before going async to come up the stack where I called it instead of where I'm awaiting it. And of course I expect exceptions beyond that to only be able to be retrieved when I await the task since the call stack will be rooted in the event loop after going async.