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

Method returnReply

lib/DataHandler.ts:91–120  ·  view source on GitHub ↗
(reply: ReplyData)

Source from the content-addressed store, hash-verified

89 }
90
91 private returnReply(reply: ReplyData) {
92 if (this.handleMonitorReply(reply)) {
93 return;
94 }
95 if (this.handleSubscriberReply(reply)) {
96 return;
97 }
98
99 const item = this.shiftCommand(reply);
100 if (!item) {
101 return;
102 }
103 if (Command.checkFlag("ENTER_SUBSCRIBER_MODE", item.command.name)) {
104 this.redis.condition.subscriber = new SubscriptionSet();
105 this.redis.condition.subscriber.add(
106 item.command.name,
107 reply[1].toString()
108 );
109
110 if (!fillSubCommand(item.command, reply[2])) {
111 this.redis.commandQueue.unshift(item);
112 }
113 } else if (Command.checkFlag("EXIT_SUBSCRIBER_MODE", item.command.name)) {
114 if (!fillUnsubCommand(item.command, reply[2])) {
115 this.redis.commandQueue.unshift(item);
116 }
117 } else {
118 item.command.resolve(reply);
119 }
120 }
121
122 private handleSubscriberReply(reply: ReplyData): boolean {
123 if (!this.redis.condition.subscriber) {

Callers 1

constructorMethod · 0.95

Calls 9

handleMonitorReplyMethod · 0.95
handleSubscriberReplyMethod · 0.95
shiftCommandMethod · 0.95
fillSubCommandFunction · 0.85
fillUnsubCommandFunction · 0.85
checkFlagMethod · 0.80
toStringMethod · 0.80
resolveMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected