本文整理匯總了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