4 ms·
CountEveryBitByHand() is a function which returns a promise. (I don't know if that's what they call it in C# 5.) The await keyword is a new one in C# 5 which
by joeshaw 15y ago
CountEveryBitByHand() is a function which returns a promise. (I don't know if that's what they call it in C# 5.)
The await keyword is a new one in C# 5 which halts execution until the promise is fulfilled. Then execution is resumed from that point, and the expression can be evaluated and the function returns.
It's similar to how inlineCallbacks in Twisted work, if you're familiar with those.
- davidpadbury 15y ago(I don't know if that's what they call it in C# 5.) Tasks - http://msdn.microsoft.com/en-us/library/system.threading.tasks.task.aspx http://msdn.microsoft.com/en-us/library/system.threading.tas....