Python tornado.util.Configurable() Examples

The following are 30 code examples of tornado.util.Configurable(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module tornado.util , or try the search function .
Example #1
Source File: httpclient.py    From teleport with Apache License 2.0 6 votes vote down vote up
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) 
Example #2
Source File: httpclient.py    From teleport with Apache License 2.0 6 votes vote down vote up
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) 
Example #3
Source File: httpserver.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
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 
Example #4
Source File: httpserver.py    From teleport with Apache License 2.0 5 votes vote down vote up
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 
Example #5
Source File: httpserver.py    From teleport with Apache License 2.0 5 votes vote down vote up
def configurable_default(cls) -> Type[Configurable]:
        return HTTPServer 
Example #6
Source File: httpclient.py    From teleport with Apache License 2.0 5 votes vote down vote up
def configurable_base(cls) -> Type[Configurable]:
        return AsyncHTTPClient 
Example #7
Source File: httpclient.py    From teleport with Apache License 2.0 5 votes vote down vote up
def configurable_default(cls) -> Type[Configurable]:
        from tornado.simple_httpclient import SimpleAsyncHTTPClient

        return SimpleAsyncHTTPClient 
Example #8
Source File: ioloop.py    From teleport with Apache License 2.0 5 votes vote down vote up
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) 
Example #9
Source File: ioloop.py    From teleport with Apache License 2.0 5 votes vote down vote up
def configurable_default(cls) -> Type[Configurable]:
        from tornado.platform.asyncio import AsyncIOLoop

        return AsyncIOLoop 
Example #10
Source File: httpserver.py    From pySINDy with MIT License 5 votes vote down vote up
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 
Example #11
Source File: ioloop.py    From teleport with Apache License 2.0 5 votes vote down vote up
def configurable_default(cls) -> Type[Configurable]:
        from tornado.platform.asyncio import AsyncIOLoop

        return AsyncIOLoop 
Example #12
Source File: httpserver.py    From V1EngineeringInc-Docs with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
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 
Example #13
Source File: httpserver.py    From V1EngineeringInc-Docs with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
def configurable_base(cls) -> Type[Configurable]:
        return HTTPServer 
Example #14
Source File: httpserver.py    From V1EngineeringInc-Docs with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
def configurable_default(cls) -> Type[Configurable]:
        return HTTPServer 
Example #15
Source File: httpclient.py    From V1EngineeringInc-Docs with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
def configurable_base(cls) -> Type[Configurable]:
        return AsyncHTTPClient 
Example #16
Source File: httpclient.py    From V1EngineeringInc-Docs with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
def configurable_default(cls) -> Type[Configurable]:
        from tornado.simple_httpclient import SimpleAsyncHTTPClient

        return SimpleAsyncHTTPClient 
Example #17
Source File: ioloop.py    From V1EngineeringInc-Docs with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
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) 
Example #18
Source File: ioloop.py    From V1EngineeringInc-Docs with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
def configurable_base(cls) -> Type[Configurable]:
        return IOLoop 
Example #19
Source File: ioloop.py    From V1EngineeringInc-Docs with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
def configurable_default(cls) -> Type[Configurable]:
        from tornado.platform.asyncio import AsyncIOLoop

        return AsyncIOLoop 
Example #20
Source File: ioloop.py    From opendevops with GNU General Public License v3.0 5 votes vote down vote up
def configurable_default(cls) -> Type[Configurable]:
        from tornado.platform.asyncio import AsyncIOLoop

        return AsyncIOLoop 
Example #21
Source File: httpserver.py    From tornado-zh with MIT License 5 votes vote down vote up
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 
Example #22
Source File: httpserver.py    From opendevops with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #23
Source File: httpserver.py    From opendevops with GNU General Public License v3.0 5 votes vote down vote up
def configurable_base(cls) -> Type[Configurable]:
        return HTTPServer 
Example #24
Source File: httpserver.py    From opendevops with GNU General Public License v3.0 5 votes vote down vote up
def configurable_default(cls) -> Type[Configurable]:
        return HTTPServer 
Example #25
Source File: httpclient.py    From opendevops with GNU General Public License v3.0 5 votes vote down vote up
def configurable_base(cls) -> Type[Configurable]:
        return AsyncHTTPClient 
Example #26
Source File: httpclient.py    From opendevops with GNU General Public License v3.0 5 votes vote down vote up
def configurable_default(cls) -> Type[Configurable]:
        from tornado.simple_httpclient import SimpleAsyncHTTPClient

        return SimpleAsyncHTTPClient 
Example #27
Source File: ioloop.py    From opendevops with GNU General Public License v3.0 5 votes vote down vote up
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) 
Example #28
Source File: ioloop.py    From opendevops with GNU General Public License v3.0 5 votes vote down vote up
def configurable_base(cls) -> Type[Configurable]:
        return IOLoop 
Example #29
Source File: httpserver.py    From tornado-zh with MIT License 5 votes vote down vote up
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 
Example #30
Source File: httpserver.py    From teleport with Apache License 2.0 5 votes vote down vote up
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