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

Class Command

lib/Command.ts:114–539  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112 * ```
113 */
114export default class Command implements Respondable {
115 static FLAGS: {
116 [key in keyof CommandNameFlags]: CommandNameFlags[key];
117 } = {
118 VALID_IN_SUBSCRIBER_MODE: [
119 "subscribe",
120 "psubscribe",
121 "unsubscribe",
122 "punsubscribe",
123 "ssubscribe",
124 "sunsubscribe",
125 "ping",
126 "quit",
127 ],
128 VALID_IN_MONITOR_MODE: ["monitor", "auth"],
129 ENTER_SUBSCRIBER_MODE: ["subscribe", "psubscribe", "ssubscribe"],
130 EXIT_SUBSCRIBER_MODE: ["unsubscribe", "punsubscribe", "sunsubscribe"],
131 WILL_DISCONNECT: ["quit"],
132 HANDSHAKE_COMMANDS: ["auth", "select", "client", "readonly", "info"],
133 IGNORE_RECONNECT_ON_ERROR: ["client"],
134 BLOCKING_COMMANDS: [
135 "blpop",
136 "brpop",
137 "brpoplpush",
138 "blmove",
139 "bzpopmin",
140 "bzpopmax",
141 "bzmpop",
142 "blmpop",
143 "xread",
144 "xreadgroup",
145 ],
146 LAST_ARG_TIMEOUT_COMMANDS: [
147 "blpop",
148 "brpop",
149 "brpoplpush",
150 "blmove",
151 "bzpopmin",
152 "bzpopmax",
153 ],
154 FIRST_ARG_TIMEOUT_COMMANDS: ["bzmpop", "blmpop"],
155 BLOCK_OPTION_COMMANDS: ["xread", "xreadgroup"],
156 };
157
158 private static flagMap?: FlagMap;
159 private static _transformer: {
160 argument: { [command: string]: ArgumentTransformer };
161 reply: { [command: string]: ReplyTransformer };
162 } = {
163 argument: {},
164 reply: {},
165 };
166
167 /**
168 * Check whether the command has the flag
169 */
170 static checkFlag<T extends keyof CommandNameFlags>(
171 flagName: T,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…