2 ms·
C# has async/await and TPL, e.g. .ContinueWith(...) Javscript has promises and async/await
by bbcbasic 9y ago
C# has async/await and TPL, e.g. .ContinueWith(...)
Javscript has promises and async/await
- bbcbasic 9y agoIf anyone can feedback on why my comment is wrong I'd appreciate it. I know we're not meant to comment on downvoting but I want to uncover the error in my understanding of this subject because at least 3 people downvoted but there is no reply yet??
- AstralStorm 9y agoAsync/await does not allow you to suspend a computation and then resume it, and it is not easy to chain.
- bbcbasic 9y agoThanks. I took continuation to include cases where you respond to asynchronous call backs while the program is still executing, in which case suspension isn't needed.
- somethingsimple 9y agoIf you implement your own awaiter with INotifyCompletion [1], you get the continuation as an Action that you can invoke as you will. TBH I haven't done it, but I believe you could use that to implement something akin to call/cc. [1] https://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.inotifycompletion(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/system.runtime.comp...