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

Method connect

packages/client/lib/client/pool.ts:408–425  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

406 }
407
408 async connect() {
409 if (this._self.#isOpen) return; // TODO: throw error?
410 this._self.#isOpen = true;
411
412 const promises = [];
413 while (promises.length < this._self.#options.minimum) {
414 promises.push(this._self.#create());
415 }
416
417 try {
418 await Promise.all(promises);
419 } catch (err) {
420 this.destroy();
421 throw err;
422 }
423
424 return this as unknown as RedisClientPoolType<M, F, S, RESP, TYPE_MAPPING>;
425 }
426
427 async #create() {
428 const client = this._self.#clientFactory();

Callers 1

#createMethod · 0.45

Calls 3

destroyMethod · 0.95
#createMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected