@johnemajor I believe this fixes the problem you were having with cherrypy Autoreload failing.
This PR adds a threading.Event to coordinate shutdown. Similar to a queue, it is built to be thread-safe. It allows cherrypy to signal shutdown when it's Autoreload detects file changes. The problem was with OSC threads hanging around. In this PR a thread is created to launch OSC, wait for the shutdown event, then cleanup the OSC threads.
I think this removes the need for the restart_server() method, but please correct me if I've misunderstood.
Also, the ShowRunner main loop is more responsive. Previously, time.sleep(delay) would prevent a shutdown until possibly delay seconds pass. In this PR, that can be interrupted and shutdown immediately.
@johnemajor I believe this fixes the problem you were having with cherrypy Autoreload failing.
This PR adds a
threading.Event
to coordinate shutdown. Similar to a queue, it is built to be thread-safe. It allows cherrypy to signal shutdown when it's Autoreload detects file changes. The problem was with OSC threads hanging around. In this PR a thread is created to launch OSC, wait for the shutdown event, then cleanup the OSC threads.I think this removes the need for the
restart_server()
method, but please correct me if I've misunderstood.Also, the
ShowRunner
main loop is more responsive. Previously,time.sleep(delay)
would prevent a shutdown until possiblydelay
seconds pass. In this PR, that can be interrupted and shutdown immediately.