Though there's a little more to it than that (eg - pulling the event data to pass to the coroutines!). Better to read the original source file and get the full picture.
Creator, on 05 March 2015 - 03:59 PM, said:
How do I do the third step and it appears to never resume the coroutine because the desktop app is set to turn the screen purple, but it never happens.
When the desktop app yields, it may be calling coroutine.yield() with a parameter, which it probably intends to be an event filter. For example, it might use "char", "key", "timer", or any of the other event names. coroutine.resume() passes these parameters back to the parent process as return values.
You need to ensure that when your coroutine manager detects such an event, that it passes that event data back to the desktop app when it coroutine.resume()'s it. You also need to ensure that, if an event filter was specified, you don't resume the desktop app until the appropriate event appears in the queue.
If you simply resume the desktop app at any time, it'll likely break it. If you resume the desktop app without ever passing it any event data, it'll most certainly break it.
Edited by Bomb Bloke, 05 March 2015 - 10:14 PM.