Get a connection from the pool, without making sure it is connected
(self)
| 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""" |
no test coverage detected