Closed stankudrow closed 1 month ago
I think these Pool
properties are error-prone and are better to be replaced with async
methods, e.g., get_free_connections()
with async with self._lock
context.
Perhaps this PR should be closed and in favour of the PR with properties replaced with corresponding coro methods for ensuring the coroutine-safety.
The
pool.available_connections
property shows the number of connections one can request from the pool.If a pool object is requested to give out a connection when the number of acquired connections is equal to the
pool.maxsize
property, theAsynchPoolError
is raised because the pool cannot give birth to a connection when its capacities are exceeded.A possible use case:
The source of inspiration: the issue #121 by @itssimon .