本文整理汇总了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)
示例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
示例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
示例4: configurable_base
# 需要导入模块: from tornado import util [as 别名]
# 或者: from tornado.util import Configurable [as 别名]
def configurable_base(cls) -> Type[Configurable]:
return HTTPServer
示例5: configurable_default
# 需要导入模块: from tornado import util [as 别名]
# 或者: from tornado.util import Configurable [as 别名]
def configurable_default(cls) -> Type[Configurable]:
return HTTPServer
示例6: configurable_base
# 需要导入模块: from tornado import util [as 别名]
# 或者: from tornado.util import Configurable [as 别名]
def configurable_base(cls) -> Type[Configurable]:
return AsyncHTTPClient
示例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
示例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)
示例9: configurable_base
# 需要导入模块: from tornado import util [as 别名]
# 或者: from tornado.util import Configurable [as 别名]
def configurable_base(cls) -> Type[Configurable]:
return IOLoop
示例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