minos.common.pools module

class minos.common.pools.MinosPool(*args, maxsize=10, recycle=300, already_setup=True, **kwargs)[source]

Bases: minos.common.setup.MinosSetup, aiomisc.pool.PoolBase, Generic[minos.common.pools.P], abc.ABC

Base class for Pool implementations in minos

__init__(*args, maxsize=10, recycle=300, already_setup=True, **kwargs)[source]
acquire(*args, **kwargs)[source]

Acquire a new instance wrapped on an asynchronous context manager.

Parameters
  • args – Additional positional arguments.

  • kwargs – Additional named arguments.

Return type

~P

Returns

An asynchronous context manager.

property already_destroyed: bool

Already Destroy getter.

Return type

bool

Returns

A boolean value.

property already_setup: bool

Already Setup getter.

Return type

bool

Returns

A boolean value.

async close(timeout=None)
Return type

None

async destroy()

Destroy miscellaneous repository things.

Return type

None

Returns

This method does not return anything.

classmethod from_config(config=None, **kwargs)

Build a new instance from config.

Parameters
Return type

~S

Returns

A instance of the called class.

async setup()

Setup miscellaneous repository things.

Return type

None

Returns

This method does not return anything.