| ▲ | jayd16 7 hours ago | ||||||||||||||||||||||||||||
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. | |||||||||||||||||||||||||||||
| ▲ | throwup238 6 hours ago | parent [-] | ||||||||||||||||||||||||||||
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. | |||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||