Skip to content

Commit 5a12683

Browse files
committed
refactor: reorganize pool properties below constructor
1 parent 79932db commit 5a12683

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

lib/cmap/connection_pool.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,22 @@ class ConnectionPool extends EventEmitter {
182182
});
183183
}
184184

185+
get address() {
186+
return `${this.options.host}:${this.options.port}`;
187+
}
188+
189+
get generation() {
190+
return this[kGeneration];
191+
}
192+
193+
get totalConnectionCount() {
194+
return this[kConnections].length + (this.options.maxPoolSize - this[kPermits]);
195+
}
196+
197+
get availableConnectionCount() {
198+
return this[kConnections].length;
199+
}
200+
185201
/**
186202
* Check a connection out of this pool. The connection will continue to be tracked, but no reference to it
187203
* will be held by the pool. This means that if a connection is checked out it MUST be checked back in or
@@ -343,22 +359,6 @@ class ConnectionPool extends EventEmitter {
343359
});
344360
});
345361
}
346-
347-
get generation() {
348-
return this[kGeneration];
349-
}
350-
351-
get totalConnectionCount() {
352-
return this[kConnections].length + (this.options.maxPoolSize - this[kPermits]);
353-
}
354-
355-
get availableConnectionCount() {
356-
return this[kConnections].length;
357-
}
358-
359-
get address() {
360-
return `${this.options.host}:${this.options.port}`;
361-
}
362362
}
363363

364364
function ensureMinPoolSize(pool) {

0 commit comments

Comments
 (0)