docs: function(topology, options) {
    // Add event listener
    EventEmitter.call(this);
  
    // Store topology for later use
    this.topology = topology;
  
    // Add the options
    this.options = Object.assign(
      {
        // Host and port settings
        host: 'localhost',
        port: 27017,
        // Pool default max size
        size: 5,
        // Pool default min size
        minSize: 0,
        // socket settings
        connectionTimeout: 30000,
        socketTimeout: 360000,
        keepAlive: true,
        keepAliveInitialDelay: 300000,
        noDelay: true,
        // SSL Settings
        ssl: false,
        checkServerIdentity: true,
        ca: null,
        crl: null,
        cert: null,
        key: null,
        passPhrase: null,
        rejectUnauthorized: false,
        promoteLongs: true,
        promoteValues: true,
        promoteBuffers: false,
        // Reconnection options
        reconnect: true,
        reconnectInterval: 1000,
        reconnectTries: 30,
        // Enable domains
        domainsEnabled: false
      },
      options
    );
  
    // Identification information
    this.id = _id++;
    // Current reconnect retries
    this.retriesLeft = this.options.reconnectTries;
    this.reconnectId = null;
    // No bson parser passed in
    if (
      !options.bson ||
      (options.bson &&
        (typeof options.bson.serialize !== 'function' ||
          typeof options.bson.deserialize !== 'function'))
    ) {
      throw new Error('must pass in valid bson parser');
    }
  
    // Logger instance
    this.logger = Logger('Pool', options);
    // Pool state
    this.state = DISCONNECTED;
    // Connections
    this.availableConnections = [];
    this.inUseConnections = [];
    this.connectingConnections = [];
    // Currently executing
    this.executing = false;
    // Operation work queue
    this.queue = [];
  
    // All the authProviders
    this.authProviders = options.authProviders || defaultAuthProviders(options.bson);
  
    // Contains the reconnect connection
    this.reconnectConnection = null;
  
    // Are we currently authenticating
    this.authenticating = false;
    this.loggingout = false;
    this.nonAuthenticatedConnections = [];
    this.authenticatingTimestamp = null;
    // Number of consecutive timeouts caught
    this.numberOfConsecutiveTimeouts = 0;
    // Current pool Index
    this.connectionIndex = 0;
  }