def run(self):
        self.socket = self.context.socket(zmq.REP)
        self.socket.connect(self.uri)

        try:
            while True:
                cmd, uid, args = protocol.msg.extract_request(
                    self.socket.recv()
                )
                try:
                    if cmd in self.db_commands:
                        db = None
                    else:
                        db = self.databases.get(uid)
                except Exception:
                    resp = protocol.msg.format_response(
                        uid, status=protocol.status.NO_DB)
                else:
                    if db:
                        resp = self.handle_cmd(db, self.commands, cmd, args)
                    else:
                        resp = self.handle_cmd(
                            None, self.db_commands, cmd, args
                        )
                if isinstance(resp, Multipart):
                    self.socket.send_multipart(resp)
                else:
                    self.socket.send(resp)
        except zmq.ZMQError:
            pass
        except __HOLE__:
            pass
        finally:
            self.socket.close(linger=0)
dataset/ETHPy150Open onitu/onitu/onitu/escalator/server/worker.py/Worker.run