Refactored connection pool (#913)

* Refactored ConnectionPool
- Created BaseConnectionPool class
- Created CloudConnectionPool
- connection pool updates are immutable
- resurrect now happens inside getConnection()

* Rewritten connection pool(s) type definitions

* Updated test

* Fixed test

* Fix if check

* Removed old files

* Improve code coverage

* Updated license header

* Fix if check

* Improve code coverage

* Updated coverage script
This commit is contained in:
Tomas Della Vedova
2019-07-26 11:43:48 +02:00
committed by GitHub
parent fa07de3284
commit a948a98be6
19 changed files with 1305 additions and 620 deletions

View File

@ -314,10 +314,12 @@ class Transport {
if (this._sniffEnabled === true && now > this._nextSniff) {
this.sniff({ reason: Transport.sniffReasons.SNIFF_INTERVAL, requestId: opts.requestId })
}
this.connectionPool.resurrect({ now, requestId: opts.requestId, name: this.name })
return this.connectionPool.getConnection({
filter: this.nodeFilter,
selector: this.nodeSelector
selector: this.nodeSelector,
requestId: opts.requestId,
name: this.name,
now
})
}