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

Method execute_command

redis/asyncio/cluster.py:1683–1700  ·  view source on GitHub ↗
(self, *args: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

1681 return response
1682
1683 async def execute_command(self, *args: Any, **kwargs: Any) -> Any:
1684 # Acquire connection
1685 connection = self.acquire_connection()
1686 try:
1687 # Handle lazy disconnect for connections marked for reconnect
1688 await self.disconnect_if_needed(connection)
1689
1690 # Execute command
1691 await connection.send_packed_command(connection.pack_command(*args))
1692
1693 # Read response
1694 return await self.parse_response(connection, args[0], **kwargs)
1695 finally:
1696 try:
1697 await self.disconnect_if_needed(connection)
1698 finally:
1699 # Release connection
1700 self.release(connection)
1701
1702 async def execute_pipeline(self, commands: List["PipelineCommand"]) -> bool:
1703 # Acquire connection

Calls 6

acquire_connectionMethod · 0.95
disconnect_if_neededMethod · 0.95
parse_responseMethod · 0.95
releaseMethod · 0.95
send_packed_commandMethod · 0.45
pack_commandMethod · 0.45