|
|
|
|
|
by jayd16
1465 days ago
|
|
Yeah, it's a nice way to kludge in yielding/cooperative execution without bringing in the threading syntax of async/await. It's still a bit of a miss match though. Delay instructions and waiting for other coroutines are implemented as type unsafe yield return values. Still, a pretty good hack. It ends up with a lot less garbage than async/await. |
|
This is how ValueTask is implemented in newer .NET versions which is a struct, but you can roll your own.