(reply: ReplyData)
| 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) { |
no test coverage detected