-
Notifications
You must be signed in to change notification settings - Fork 156
implemented maxConnectionPoolSize logic #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
lutovich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ali-ince changes look good. Made couple minor comments. Maybe also worth adding an integration test for max connections. All this can be done in a separate PR.
| this._destroyConnection.bind(this), | ||
| this._validateConnection.bind(this), | ||
| config.connectionPoolSize | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about adding a dedicated PoolConfig class for this object?
Then it will be possible to specify type of config constructor parameter in Pool in JSDoc and get autocompletion from Intellij.
src/v1/internal/pool.js
Outdated
| if (!pool) { | ||
| pool = []; | ||
| this._pools[key] = pool; | ||
| let resource = this._acquire(key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe change lets and vars to consts in this class, where possible.
src/v1/internal/util.js
Outdated
| } | ||
|
|
||
| function promiseOrTimeout(timeout, otherPromise, onTimeout) { | ||
| let timeoutPromise = new Promise((resolve, reject) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use const
No description provided.