def listen(self, callback=None, timeout=(5, 300)):
        """Start the &listen long poll and return immediately."""
        if self._running:
            return False
        # if self.devices() is False:
        #    return False
        self._queue = Queue()
        self._running = True
        self._timeout = timeout
        self._callback_listen = callback
        threading.Thread(target=self._thread_listen, args=()).start()
        threading.Thread(target=self._thread_worker, args=()).start()
        return True
def listen ( self , callback = None , timeout = ( 5 , 300 ) ) : if self . _running : return False self . _queue = Queue ( ) self . _running = True self . _timeout = timeout self . _callback_listen = callback threading . Thread ( target = self . _thread_listen , args = ( ) ) . start ( ) threading . Thread ( target = self . _thread_worker , args = ( ) ) . start ( ) return True
Start the &listen long poll and return immediately.