Skip to content
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

Suggestion on softEvictConnections #306

Open
terryzhan0211 opened this issue Jul 8, 2023 · 0 comments
Open

Suggestion on softEvictConnections #306

terryzhan0211 opened this issue Jul 8, 2023 · 0 comments

Comments

@terryzhan0211
Copy link

Hi, I want to implement a "soft evict" in my code, similar to how it's implemented in HikariCP: https://javadoc.io/doc/com.zaxxer/HikariCP/latest/com/zaxxer/hikari/HikariPoolMXBean.html#softEvictConnections() https://github.com/brettwooldridge/HikariCP/blob/dev/src/main/java/com/zaxxer/hikari/pool/HikariPool.java#L364.
It involves evicting currently idle connections from the pool and marking active (in-use) connections for eviction when they are returned to the pool.
Currently, I have my own custom implementation where I iterate through the set that stores all connections in the pool. However, the set _allObjects, which stores all connections, is currently a private variable and has not been exported and thus requires 'as any' to use in typescript.
It works but as this logic should ideally be implemented at the pool level, can we expect an official API to be added in a future release, or perhaps consider exporting the allObjects set?
I would appreciate any suggestions you may have. Thanks for creating this library!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant