File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -83,13 +83,16 @@ Consider the following example:
8383// Cluster is put into MULTI state locally
8484$obj_cluster->multi();
8585
86- for ($i = 0; $i < 10; $i++) {
87- // MULTI will be delivered only once per node
88- $obj_cluster->get("key:$i");
89- }
86+ // The cluster will issue MULTI on this node first (and only once)
87+ $obj_cluster->get("mykey");
88+ $obj_cluster->set("mykey", "new_value");
89+
90+ // If 'myotherkey' maps to a different node, MULTI will be issued there
91+ // before requesting the key
92+ $obj_cluster->get("myotherkey");
9093
91- // This always returns an array of 10 elements, of which some could be false
92- // (for example if a slot had been migrated)
94+ // This will always return an array, even in the event of a failed transaction
95+ // on one of the nodes, in which case that element will be FALSE
9396print_r($obj_cluster->exec());
9497</pre >
9598
You can’t perform that action at this time.
0 commit comments