当前位置: 首页>>代码示例>>Python>>正文


Python Request.parse_msg方法代码示例

本文整理汇总了Python中request.Request.parse_msg方法的典型用法代码示例。如果您正苦于以下问题:Python Request.parse_msg方法的具体用法?Python Request.parse_msg怎么用?Python Request.parse_msg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在request.Request的用法示例。


在下文中一共展示了Request.parse_msg方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: process_message

# 需要导入模块: from request import Request [as 别名]
# 或者: from request.Request import parse_msg [as 别名]
 def process_message(self, application, message):
     """This coroutine looks at the message, determines which handler will
     be used to process it, and then begins processing.
     
     The application is responsible for handling misconfigured routes.
     """
     request = Request.parse_msg(message)
     if request.is_disconnect():
         return  # Ignore disconnect msgs. Dont have areason to do otherwise
     handler = application.route_message(request)
     if callable(handler):
         response = handler()
     application.msg_conn.reply(request, response)
开发者ID:repos-python,项目名称:brubeck,代码行数:15,代码来源:connections.py

示例2: process_message

# 需要导入模块: from request import Request [as 别名]
# 或者: from request.Request import parse_msg [as 别名]
    def process_message(self, application, message):
        """This coroutine looks at the message, determines which handler will
        be used to process it, and then begins processing.

        The application is responsible for handling misconfigured routes.
        """
        request = Request.parse_msg(message)
        if request.is_disconnect():
            return  # Ignore disconnect msgs. Dont have a reason to do otherwise
        handler = application.route_message(request)
        result = handler()
        # in case of long poll we do not want to send reply
        if result is not None:
            self.reply(request, result)
开发者ID:fleephub,项目名称:brubeck,代码行数:16,代码来源:connections.py

示例3: process_message

# 需要导入模块: from request import Request [as 别名]
# 或者: from request.Request import parse_msg [as 别名]
    def process_message(self, application, message):
        """This coroutine looks at the message, determines which handler will
        be used to process it, and then begins processing.
        
        The application is responsible for handling misconfigured routes.
        """
        request = Request.parse_msg(message)
        if request.is_disconnect():
            return  # Ignore disconnect msgs. Dont have areason to do otherwise
        handler = application.route_message(request)
        result = handler()

        http_content = http_response(result['body'], result['status_code'],
                                     result['status_msg'], result['headers'])

        application.msg_conn.reply(request, http_content)
开发者ID:darkdarkfruit,项目名称:brubeck,代码行数:18,代码来源:connections.py


注:本文中的request.Request.parse_msg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。