INNER CODE UNIT · TypeScript

Cluster

denodrivers/mongo · src/cluster.ts:6

export class Cluster {
  #options: ConnectOptions;
  #connections: Deno.Conn[];
  #protocols: WireProtocol[];
  #masterIndex: number;

  constructor(options: ConnectOptions) {
    this.#options = options;
    this.#connections = [];
    this.#protocols = [];
    this.#masterIndex = -1;
  }

  async connect() {
    const options = this.#options;
    this.#connections = await Promise.all(
      options.servers.map((server) => this.connectToServer(server, options)),
    );

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…