logoalt Hacker News

jayd16today at 4:25 PM1 replyview on HN

C# works like this as well, no? In fact C# can (will?) run the async function on the calling thread until a yield is hit.


Replies

throwup238today at 5:09 PM

So do Python and Javascript. I think most languages with async/await also support noop-ing the yield if the future is already resolved. It’s only when you create a new task/promise that stuff is guaranteed to get scheduled instead of possibly running immediately.

show 1 reply