This code is not working......
self._thread = threading.Timer(interval=2,
function=self._sendRequestState,
args=(self._lockState,),
daemon=True).start()
So I should write down like this..
self._thread = threading.Timer(interval=2,
function=self._sendRequestState,
args=(self._lockState,))
self._thread.daemon = True
self._thread.start()
But the Timer
class has Thread.__init__
, Thread.__init__
has "daemon
" for input parameter.
I don't have any idea why it doesn't work...
daemon
threads are left, and your thread will never have time to execute. – Steeplebush