minos.plugins.aiohttp.connectors

Classes

AioHttpConnector

AioHttp Connector class.

class AioHttpConnector[source]

Bases: HttpConnector[Request, Response]

AioHttp Connector class.

__init__(*args, shutdown_timeout=6, **kwargs)[source]
Parameters

shutdown_timeout (float) –

property shutdown_timeout: float

Get the shutdown timeout.

Returns

A float value.

property runner: Optional[aiohttp.web_runner.AppRunner]

Get the application runner.

Returns

An AppRunner instance or None.

property site: Optional[aiohttp.web_runner.TCPSite]

Get the application site.

Returns

A SockSite instance or None.

application

Get the application.

Returns

An Application instance.

adapt_callback(callback)

Get the adapted callback to be used by the connector.

Parameters

callback (Callable[[Request], Union[Response, None, Awaitable[Optional[Response]]]]) – The function.

Returns

A wrapper function on top of the given one that is compatible with the connector.

Return type

Callable[[RawRequest], Awaitable[RawResponse]]

property adapter: minos.networks.http.adapters.HttpAdapter

Get the port.

Returns

A int value.

property already_destroyed: bool

Already Destroy getter.

Returns

A boolean value.

property already_setup: bool

Already Setup getter.

Returns

A boolean value.

async destroy()

Destroy miscellaneous repository things.

Returns

This method does not return anything.

Return type

None

classmethod from_config(config=None, **kwargs)

Build a new instance from config.

Parameters
  • config (Optional[Union[Config, Path]]) – Config instance. If None is provided, default config is chosen.

  • kwargs – Additional named arguments.

Returns

A instance of the called class.

Return type

S

classmethod get_injectable_name()

Get the injectable name.

Returns

A str value.

Return type

str

property host: str

Get the host.

Returns

A str value.

mount_route(path, method, callback)

Mount a new route on the application.

Parameters
Returns

This method does not return anything.

mount_routes()

Mount the routes given by the adapter.

Returns

This method does not return anything.

Return type

None

property port: int

Get the port.

Returns

A int value.

property routes: dict[minos.networks.decorators.definitions.http.abc.HttpEnrouteDecorator, collections.abc.Callable[[minos.networks.requests.abc.Request], Union[minos.networks.requests.abc.Response, NoneType, Awaitable[Optional[minos.networks.requests.abc.Response]]]]]

Get the port.

Returns

A int value.

async setup()

Setup miscellaneous repository things.

Returns

This method does not return anything.

Return type

None

async start()

Start the connector.

Returns

This method does not return anything.

Return type

None

async stop()

Stop the connector.

Returns

This method does not return anything.

Return type

None