MCPcopy
hub / github.com/redis/redis-py / get_available_connection

Method get_available_connection

redis/asyncio/connection.py:1604–1613  ·  view source on GitHub ↗

Get a connection from the pool, without making sure it is connected

(self)

Source from the content-addressed store, hash-verified

1602 raise
1603
1604 def get_available_connection(self):
1605 """Get a connection from the pool, without making sure it is connected"""
1606 try:
1607 connection = self._available_connections.pop()
1608 except IndexError:
1609 if len(self._in_use_connections) >= self.max_connections:
1610 raise MaxConnectionsError("Too many connections") from None
1611 connection = self.make_connection()
1612 self._in_use_connections.add(connection)
1613 return connection
1614
1615 def get_encoder(self):
1616 """Return an encoder based on encoding settings"""

Callers 2

get_connectionMethod · 0.95
get_connectionMethod · 0.80

Calls 3

make_connectionMethod · 0.95
MaxConnectionsErrorClass · 0.90
addMethod · 0.45

Tested by

no test coverage detected