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

Method _execute_pipeline

redis/asyncio/client.py:1946–1964  ·  view source on GitHub ↗
(
        self, connection: Connection, commands: CommandStackT, raise_on_error: bool
    )

Source from the content-addressed store, hash-verified

1944 return data
1945
1946 async def _execute_pipeline(
1947 self, connection: Connection, commands: CommandStackT, raise_on_error: bool
1948 ):
1949 # build up all commands into a single request to increase network perf
1950 all_cmds = connection.pack_commands([args for args, _ in commands])
1951 await connection.send_packed_command(all_cmds)
1952
1953 response = []
1954 for args, options in commands:
1955 try:
1956 response.append(
1957 await self.parse_response(connection, args[0], **options)
1958 )
1959 except ResponseError as e:
1960 response.append(e)
1961
1962 if raise_on_error:
1963 self.raise_first_error(commands, response)
1964 return response
1965
1966 def raise_first_error(self, commands: CommandStackT, response: Iterable[Any]):
1967 for i, r in enumerate(response):

Callers

nothing calls this directly

Calls 5

parse_responseMethod · 0.95
raise_first_errorMethod · 0.95
pack_commandsMethod · 0.45
send_packed_commandMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected