2 ms·
Sure. I basically take the async callback and wrap it in a coroutine before I invoke it. If the coroutine yields back a function, I assume that that function ca
by chrisfarber 14y ago
Sure. I basically take the async callback and wrap it in a coroutine before I invoke it. If the coroutine yields back a function, I assume that that function can be repeatedly invoked until it returns a truthy value indicating it wants to resume. Unfinished coroutines are then kept in a table, and after each event from the ComputerCraft environment, I check the table of unfinished callbacks to see which ones can be resumed.