4 ms·
The new await keyword in C# can be used to write coroutines libraries like this, but instead of you writing the continuations yourself, you can let the compiler
by MarkSweep 15y ago
The new await keyword in C# can be used to write coroutines libraries like this, but instead of you writing the continuations yourself, you can let the compiler slice up your function. You can then leverage the SynchronizationContext class to control which thread the continuations run on.
Looking at the use of libtask in mongrel2 inspired me to play around with the idea of coroutines in C#. The await keyword makes my latest iteration quite small and nice to use.
https://github.com/AustinWise/LibTaskNet https://github.com/AustinWise/LibTaskNet
- aaronblohowiak 15y agoyou can also do this in luvit (libuv + lua)