()
| 876 | |
| 877 | async def _acquire(self, timeout): |
| 878 | async def _acquire_impl(): |
| 879 | ch = await self._queue.get() # type: PoolConnectionHolder |
| 880 | try: |
| 881 | proxy = await ch.acquire() # type: PoolConnectionProxy |
| 882 | except (Exception, asyncio.CancelledError): |
| 883 | self._queue.put_nowait(ch) |
| 884 | raise |
| 885 | else: |
| 886 | # Record the timeout, as we will apply it by default |
| 887 | # in release(). |
| 888 | ch._timeout = timeout |
| 889 | return proxy |
| 890 | |
| 891 | if self._closing: |
| 892 | raise exceptions.InterfaceError('pool is closing') |