MCPcopy
hub / github.com/redis/node-redis / subscribe

Method subscribe

packages/client/lib/client/commands-queue.ts:376–392  ·  view source on GitHub ↗
(
    type: PubSubType,
    channels: string | Array<string>,
    listener: PubSubListener<T>,
    returnBuffers?: T,
  )

Source from the content-addressed store, hash-verified

374 }
375
376 subscribe<T extends boolean>(
377 type: PubSubType,
378 channels: string | Array<string>,
379 listener: PubSubListener<T>,
380 returnBuffers?: T,
381 ) {
382 const command = this.#pubSub.subscribe(
383 type,
384 channels,
385 listener,
386 returnBuffers,
387 );
388 if (!command) return;
389
390 this.#setupPubSubHandler();
391 return this.#addPubSubCommand(command);
392 }
393
394 #resetDecoderCallbacks() {
395 this.decoder.onReply = ((reply) =>

Callers

nothing calls this directly

Calls 3

#setupPubSubHandlerMethod · 0.95
#addPubSubCommandMethod · 0.95
subscribeMethod · 0.65

Tested by

no test coverage detected