We have a class that manages the ticker thread, with the switch to 3.0 we can't use the KiteTicker class directly because we are not running it in the main thread, and we can't use the threaded option in connect() because this creates a new thread in our ticker thread, which is suppose to block on the connect function.
This is the relevant snippet from the current version of the connect() function -
# Run in seperate thread of blocking
opts = {}
if threaded:
# Signals are not allowed in non main thread by twisted so supress it.
opts["installSignalHandlers"] = False
self.websocket_thread = threading.Thread(target=reactor.run, kwargs=opts)
self.websocket_thread.daemon = True
self.websocket_thread.start()
else:
reactor.run(**opts)
Ideally we would like an input flag on the connect function to be able to set the "installSignalHandlers" in the else clause in the above snippet.
We have a class that manages the ticker thread, with the switch to 3.0 we can't use the KiteTicker class directly because we are not running it in the main thread, and we can't use the
threaded
option inconnect()
because this creates a new thread in our ticker thread, which is suppose to block on theconnect
function.This is the relevant snippet from the current version of the
connect()
function -Ideally we would like an input flag on the
connect
function to be able to set the "installSignalHandlers" in the else clause in the above snippet.