根据获取到的不同请求执行不同的动作.会在建立连接后被放入事件循环.

        主要为3种请求:
        + 验证请求
        + 心跳请求
        + 任务调用请求
        如果中途有步骤报错也负责将对应的错误转化为错误信息发送给客户端.

async def query_handler(self):
        """根据获取到的不同请求执行不同的动作.会在建立连接后被放入事件循环.

        主要为3种请求:
        + 验证请求
        + 心跳请求
        + 任务调用请求
        如果中途有步骤报错也负责将对应的错误转化为错误信息发送给客户端.

        """
        while True:
            request = await self.read()
            if request is None:
                break
            ID = request.get('ID')
            try:
                if request.get("AUTH"):
                    self._check_auth_handler(request)
                elif request.get("HEARTBEAT"):
                    response = {
                        "MPRPC": self.VERSION,
                        "CODE": 101,
                        "HEARTBEAT": "pong"
                    }
                    self.writer(response)
                elif ID:
                    fut = asyncio.ensure_future(
                        self._RPC_handler(request),
                        loop=self._loop)
                    if asyncio.isfuture(fut):
                        self.tasks[ID] = fut
                        self.__class__.TASKS.append(fut)
                else:
                    raise ProtocolSyntaxException("Protocol Syntax Error")
            except MethodError as se:
                exinfo = traceback.TracebackException.from_exception(
                    se).format(chain=True)
                frames = "".join([i + "/n" for i in exinfo])
                response = {
                    "MPRPC": self.VERSION,
                    "CODE": se.status_code,
                    "MESSAGE": {
                        "ID": ID,
                        'EXCEPTION': str(type(se)),
                        'MESSAGE': str(se),
                        "DATA": {
                            'METHOD': request.get("METHOD"),
                            "ARGS": request.get("ARGS"),
                            "KWARGS": request.get("KWARGS"),
                            'FRAME': frames}
                    }
                }
                self.writer(response)
            except ServerException as me:
                response = {
                    "MPRPC": self.VERSION,
                    "CODE": me.status_code,

                }
                self.writer(response)
            except Exception as e:
                if self.debug:
                    logger.info("Unknow Error: {}[{}]".format(
                        type(e).__name__, str(e)
                    ))