MCPcopy
hub / github.com/redis/ioredis / fillSubCommand

Function fillSubCommand

lib/DataHandler.ts:259–273  ·  view source on GitHub ↗
(command: Respondable, count: number)

Source from the content-addressed store, hash-verified

257const remainingRepliesMap = new WeakMap<Respondable, number>();
258
259function fillSubCommand(command: Respondable, count: number) {
260 let remainingReplies = remainingRepliesMap.has(command)
261 ? remainingRepliesMap.get(command)
262 : command.args.length;
263
264 remainingReplies -= 1;
265
266 if (remainingReplies <= 0) {
267 command.resolve(count);
268 remainingRepliesMap.delete(command);
269 return true;
270 }
271 remainingRepliesMap.set(command, remainingReplies);
272 return false;
273}
274
275function fillUnsubCommand(command: Respondable, count: number) {
276 let remainingReplies = remainingRepliesMap.has(command)

Callers 2

returnReplyMethod · 0.85
handleSubscriberReplyMethod · 0.85

Calls 3

getMethod · 0.80
setMethod · 0.80
resolveMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…