當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。