(
self, command_name: Optional[str] = None, *keys: Any, **options: Any
)
| 3272 | return self._node.get_encoder() |
| 3273 | |
| 3274 | async def get_connection( |
| 3275 | self, command_name: Optional[str] = None, *keys: Any, **options: Any |
| 3276 | ) -> AbstractConnection: |
| 3277 | connection = self._node.acquire_connection() |
| 3278 | try: |
| 3279 | await connection.connect() |
| 3280 | except BaseException: |
| 3281 | # connect() may fail mid-handshake (e.g. after the TCP socket |
| 3282 | # is established but before AUTH/HELLO completes) leaving the |
| 3283 | # connection in a partially-connected state. Disconnect before |
| 3284 | # returning it to the node's free queue so it is not reused. |
| 3285 | await connection.disconnect() |
| 3286 | self._node.release(connection) |
| 3287 | raise |
| 3288 | return connection |
| 3289 | |
| 3290 | async def release(self, connection: AbstractConnection) -> None: |
| 3291 | # PubSub.aclose() disconnects the connection before calling |
nothing calls this directly
no test coverage detected