(self)
Continually read events and command results
Continually read events and command results
Continually read events and command results
def _receive_thread(self):
        ''' Continually read events and command results '''
        while 1:
            try:
                message = json.loads(self.ws.recv())
                if 'id' in message:
                    id = message['id']
                    event = self.requests.pop(id, None)
                    if event is not None:
                        self.results[id] = message
                        event.set()
            except Exception as e:
                break
def _receive_thread ( self ) : while 1 : try : message = json . loads ( self . ws . recv ( ) ) if 'id' in message : id = message [ 'id' ] event = self . requests . pop ( id , None ) if event is not None : self . results [ id ] = message event . set ( ) except Exception as e : break