4 ms·
Here's my (oversimplified) understanding of async: It's functions with yield points, at which other code can be run until execution returns to the function. The
by yccs27 5y ago
Here's my (oversimplified) understanding of async: It's functions with yield points, at which other code can be run until execution returns to the function. Then, isn't it almost trivial to call an async function from a synchronous context? Just skip over the yield points?
- jayd16 5y agoIt depends on the context of the yield but assuming the caller and callee contexts can be the same, most async/await implementations will not actually yield until some kind of thread sleep or explicit yield is hit. So yes, this happens in most languages I'm aware of.