1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

chain pipeline commands

This commit is contained in:
Leibale
2024-01-17 15:30:01 -05:00
parent c1fc0feed0
commit 97463e9dcc
3 changed files with 44 additions and 5 deletions

View File

@@ -749,11 +749,13 @@ export default class RedisClient<
return Promise.reject(new ClientClosedError());
}
const promise = Promise.all(
commands.map(({ args }) => this._self.#queue.addCommand(args, {
typeMapping: this._commandOptions?.typeMapping
}))
);
const chainId = Symbol('Pipeline Chain'),
promise = Promise.all(
commands.map(({ args }) => this._self.#queue.addCommand(args, {
chainId,
typeMapping: this._commandOptions?.typeMapping
}))
);
this._self.#scheduleWrite();
const result = await promise;