love.thread and non-blocking IO
Posted: Sat Jan 19, 2013 3:16 pm
I am making a 2D level editor (aren't we all...), and I have now added a console to it for debugging until I put actual GUI.
I used a separate love.Thread object on a simple file that runs io.read() and sends the input to the main thread.
This is working fine, but I can't see any way to close the console thread automatically from the main thread when quitting. Thread:kill was removed, and I can't send a message because the console is obviously blocked in io.read().
I tried to Google a non-blocking read method, but couldn't find anything.
Is there anything to do about this?
It's kind of annoying to have to press enter in the console after the editor quit already.
Thanks.
I used a separate love.Thread object on a simple file that runs io.read() and sends the input to the main thread.
This is working fine, but I can't see any way to close the console thread automatically from the main thread when quitting. Thread:kill was removed, and I can't send a message because the console is obviously blocked in io.read().
I tried to Google a non-blocking read method, but couldn't find anything.
Is there anything to do about this?
It's kind of annoying to have to press enter in the console after the editor quit already.
Thanks.