Re:Using Lua coroutines to create an RPG dialogue system
by unscaled on Thursday January 12, 2017 @04:31AM
(#13380985)
You can also implement your own event loops with promises, but it's a matter of tradeoffs again:
You can't control the way functions written by someone else will schedule their internal continuations - you can only control the way you schedule your own continuation. I'm not sure if Javascript gives you a lot of control there, but C# allows you to define your own TaskScheduler and specify it on ContinueWith.
You can't control the way functions written by someone else will schedule their internal continuations - you can only control the way you schedule your own continuation. I'm not sure if Javascript gives you a lot of control there, but C# allows you to define your own TaskScheduler and specify it on ContinueWith.