MCPcopy
hub / github.com/redis/node-redis / #handshake

Method #handshake

packages/client/lib/client/index.ts:827–844  ·  view source on GitHub ↗
(chainId: symbol, asap: boolean)

Source from the content-addressed store, hash-verified

825 }
826
827 async #handshake(chainId: symbol, asap: boolean) {
828 const promises = [];
829 const commandsWithErrorHandlers = await this.#getHandshakeCommands();
830
831 if (asap) commandsWithErrorHandlers.reverse()
832
833 for (const { cmd, errorHandler } of commandsWithErrorHandlers) {
834 promises.push(
835 this.#queue
836 .addCommand(cmd, {
837 chainId,
838 asap
839 })
840 .catch(errorHandler)
841 );
842 }
843 return promises;
844 }
845
846 async #getHandshakeCommands(): Promise<
847 Array<{ cmd: CommandArguments } & { errorHandler?: (err: Error) => void }>

Callers 2

socketInitiatorMethod · 0.95
resetMethod · 0.80

Calls 3

#getHandshakeCommandsMethod · 0.95
pushMethod · 0.45
addCommandMethod · 0.45

Tested by

no test coverage detected