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


Python gevent.wsgi方法代码示例

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


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

示例1: __init__

# 需要导入模块: import gevent [as 别名]
# 或者: from gevent import wsgi [as 别名]
def __init__(self, app):
        log.debug('initializing JSONRPCServer')
        BaseService.__init__(self, app)
        self.app = app

        self.dispatcher = LoggingDispatcher()
        # register sub dispatchers
        for subdispatcher in self.subdispatcher_classes():
            subdispatcher.register(self)

        transport = WsgiServerTransport(queue_class=gevent.queue.Queue)
        # start wsgi server as a background-greenlet
        self.listen_port = app.config['jsonrpc']['listen_port']
        self.listen_host = app.config['jsonrpc']['listen_host']
        self.wsgi_server = gevent.wsgi.WSGIServer((self.listen_host, self.listen_port),
                                                  transport.handle, log=WSGIServerLogger)
        self.rpc_server = RPCServerGreenlets(
            transport,
            JSONRPCProtocol(),
            self.dispatcher
        )
        self.default_block = 'latest' 
开发者ID:heikoheiko,项目名称:pyethapp,代码行数:24,代码来源:jsonrpc.py

示例2: run

# 需要导入模块: import gevent [as 别名]
# 或者: from gevent import wsgi [as 别名]
def run(self, handler):
        from gevent import wsgi as wsgi_fast, pywsgi, monkey, local
        if self.options.get('monkey', True):
            if not threading.local is local.local: monkey.patch_all()
        wsgi = wsgi_fast if self.options.get('fast') else pywsgi
        wsgi.WSGIServer((self.host, self.port), handler).serve_forever() 
开发者ID:zhangzhengde0225,项目名称:VaspCZ,代码行数:8,代码来源:bottle.py

示例3: __init__

# 需要导入模块: import gevent [as 别名]
# 或者: from gevent import wsgi [as 别名]
def __init__(self, app):
        log.debug('initializing JSONRPCServer')
        BaseService.__init__(self, app)
        self.app = app
        self.dispatcher = RPCDispatcher()
        transport = WsgiServerTransport(queue_class=gevent.queue.Queue)

        # start wsgi server as a background-greenlet
        self.wsgi_server = gevent.wsgi.WSGIServer(('127.0.0.1', 5000), transport.handle)

        self.rpc_server = RPCServerGreenlets(
            transport,
            JSONRPCProtocol(),
            self.dispatcher
        ) 
开发者ID:heikoheiko,项目名称:pydevp2p,代码行数:17,代码来源:jsonrpc.py

示例4: make_app

# 需要导入模块: import gevent [as 别名]
# 或者: from gevent import wsgi [as 别名]
def make_app():
    return tornado.wsgi.WSGIApplication([
        (r"/", MainHandler),
        (r"/query", QueryHandler)],
        template_path=os.path.join(os.path.dirname(__file__), "templates"),
        static_path=os.path.join(os.path.dirname(__file__), "static"),
        debug=True) 
开发者ID:ayoungprogrammer,项目名称:nlquery,代码行数:9,代码来源:main.py

示例5: serve_gevent

# 需要导入模块: import gevent [as 别名]
# 或者: from gevent import wsgi [as 别名]
def serve_gevent(app):
    from gevent.wsgi import WSGIServer

    http_server = WSGIServer((host, port), app)
    http_server.serve_forever() 
开发者ID:rgalanakis,项目名称:hostthedocs,代码行数:7,代码来源:getconfig.py


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