Probably depends whether love.event.quit('restart') only kills off the active thread's lua state, the main one's regardless which thread it was called from, or all of them; i haven't looked into the source to see which it is.pgimeno wrote: ↑Sun Jan 28, 2018 5:00 pm I'm wondering if it's possible to call love.event.quit("restart") from a thread. The docs don't mention this, but I don't see why not. So, you could have a dedicated thread monitoring your filesystem. Perhaps even interfacing to a file modification monitor library via FFI if available.
The only problem I see with this way of restarting is that while hot restarting, you should ensure that your program returns false in the love.quit() event if you define it. That's where it may interfere with some workflows and require manual intervention. Maybe Löve could incorporate love.event.quit("forcerestart") to ignore the result of love.quit(), but I'm not sure that's wise. It would be best if Löve was also changed to make love.quit() receive a force parameter that is true if it will ignore the return value and quit straight away.
I also don't know whether supplying 'restart' makes löve execute the love.quit callback or whether it just skips it entirely.