node-redis icon indicating copy to clipboard operation
node-redis copied to clipboard

How auto-pipelining works?

Open MARCROCK22 opened this issue 1 year ago • 1 comments

Description

how can I check if something is being executed as a pipeline? I know that docs says this code is automatically handled as a pipeline because they are in the same "tick":

await Promise.all([
   client.set(...),
   client.set(...),
   client.set(...),
])

but

const promises: Promise<unknown>[] = [];

for (const [key, value] of data) {
    promises.push(client.hSet(key, value));
    promises.push(client.expire(key, ...));
}

await Promise.all(promises);

is this being executed as a pipeline?

MARCROCK22 avatar Sep 18 '24 01:09 MARCROCK22