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


Python util.Configurable方法代码示例

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


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

示例1: configure

# 需要导入模块: from tornado import util [as 别名]
# 或者: from tornado.util import Configurable [as 别名]
def configure(
        cls, impl: "Union[None, str, Type[Configurable]]", **kwargs: Any
    ) -> None:
        """Configures the `AsyncHTTPClient` subclass to use.

        ``AsyncHTTPClient()`` actually creates an instance of a subclass.
        This method may be called with either a class object or the
        fully-qualified name of such a class (or ``None`` to use the default,
        ``SimpleAsyncHTTPClient``)

        If additional keyword arguments are given, they will be passed
        to the constructor of each subclass instance created.  The
        keyword argument ``max_clients`` determines the maximum number
        of simultaneous `~AsyncHTTPClient.fetch()` operations that can
        execute in parallel on each `.IOLoop`.  Additional arguments
        may be supported depending on the implementation class in use.

        Example::

           AsyncHTTPClient.configure("tornado.curl_httpclient.CurlAsyncHTTPClient")
        """
        super(AsyncHTTPClient, cls).configure(impl, **kwargs) 
开发者ID:tp4a,项目名称:teleport,代码行数:24,代码来源:httpclient.py

示例2: __init__

# 需要导入模块: from tornado import util [as 别名]
# 或者: from tornado.util import Configurable [as 别名]
def __init__(self, *args, **kwargs):
        # Ignore args to __init__; real initialization belongs in
        # initialize since we're Configurable. (there's something
        # weird in initialization order between this class,
        # Configurable, and TCPServer so we can't leave __init__ out
        # completely)
        pass 
开发者ID:tao12345666333,项目名称:tornado-zh,代码行数:9,代码来源:httpserver.py

示例3: __init__

# 需要导入模块: from tornado import util [as 别名]
# 或者: from tornado.util import Configurable [as 别名]
def __init__(self, *args: Any, **kwargs: Any) -> None:
        # Ignore args to __init__; real initialization belongs in
        # initialize since we're Configurable. (there's something
        # weird in initialization order between this class,
        # Configurable, and TCPServer so we can't leave __init__ out
        # completely)
        pass 
开发者ID:opendevops-cn,项目名称:opendevops,代码行数:9,代码来源:httpserver.py

示例4: configurable_base

# 需要导入模块: from tornado import util [as 别名]
# 或者: from tornado.util import Configurable [as 别名]
def configurable_base(cls) -> Type[Configurable]:
        return HTTPServer 
开发者ID:opendevops-cn,项目名称:opendevops,代码行数:4,代码来源:httpserver.py

示例5: configurable_default

# 需要导入模块: from tornado import util [as 别名]
# 或者: from tornado.util import Configurable [as 别名]
def configurable_default(cls) -> Type[Configurable]:
        return HTTPServer 
开发者ID:opendevops-cn,项目名称:opendevops,代码行数:4,代码来源:httpserver.py

示例6: configurable_base

# 需要导入模块: from tornado import util [as 别名]
# 或者: from tornado.util import Configurable [as 别名]
def configurable_base(cls) -> Type[Configurable]:
        return AsyncHTTPClient 
开发者ID:opendevops-cn,项目名称:opendevops,代码行数:4,代码来源:httpclient.py

示例7: configurable_default

# 需要导入模块: from tornado import util [as 别名]
# 或者: from tornado.util import Configurable [as 别名]
def configurable_default(cls) -> Type[Configurable]:
        from tornado.simple_httpclient import SimpleAsyncHTTPClient

        return SimpleAsyncHTTPClient 
开发者ID:opendevops-cn,项目名称:opendevops,代码行数:6,代码来源:httpclient.py

示例8: configure

# 需要导入模块: from tornado import util [as 别名]
# 或者: from tornado.util import Configurable [as 别名]
def configure(
        cls, impl: "Union[None, str, Type[Configurable]]", **kwargs: Any
    ) -> None:
        if asyncio is not None:
            from tornado.platform.asyncio import BaseAsyncIOLoop

            if isinstance(impl, str):
                impl = import_object(impl)
            if isinstance(impl, type) and not issubclass(impl, BaseAsyncIOLoop):
                raise RuntimeError(
                    "only AsyncIOLoop is allowed when asyncio is available"
                )
        super(IOLoop, cls).configure(impl, **kwargs) 
开发者ID:opendevops-cn,项目名称:opendevops,代码行数:15,代码来源:ioloop.py

示例9: configurable_base

# 需要导入模块: from tornado import util [as 别名]
# 或者: from tornado.util import Configurable [as 别名]
def configurable_base(cls) -> Type[Configurable]:
        return IOLoop 
开发者ID:opendevops-cn,项目名称:opendevops,代码行数:4,代码来源:ioloop.py

示例10: configurable_default

# 需要导入模块: from tornado import util [as 别名]
# 或者: from tornado.util import Configurable [as 别名]
def configurable_default(cls) -> Type[Configurable]:
        from tornado.platform.asyncio import AsyncIOLoop

        return AsyncIOLoop 
开发者ID:opendevops-cn,项目名称:opendevops,代码行数:6,代码来源:ioloop.py


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