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

Method _execute_pipeline_by_slot

redis/commands/cluster.py:201–216  ·  view source on GitHub ↗
(
        self, command: str, slots_to_args: Mapping[int, Iterable[EncodableT]]
    )

Source from the content-addressed store, hash-verified

199 return slots_to_pairs
200
201 def _execute_pipeline_by_slot(
202 self, command: str, slots_to_args: Mapping[int, Iterable[EncodableT]]
203 ) -> List[Any]:
204 read_from_replicas = self.read_from_replicas and command in READ_COMMANDS
205 pipe = self.pipeline()
206 [
207 pipe.execute_command(
208 command,
209 *slot_args,
210 target_nodes=[
211 self.nodes_manager.get_node_from_slot(slot, read_from_replicas)
212 ],
213 )
214 for slot, slot_args in slots_to_args.items()
215 ]
216 return pipe.execute()
217
218 def _reorder_keys_by_command(
219 self,

Callers 3

mget_nonatomicMethod · 0.95
mset_nonatomicMethod · 0.95

Calls 4

pipelineMethod · 0.45
execute_commandMethod · 0.45
get_node_from_slotMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected