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

min vs minIdle #12

Closed
mattfysh opened this issue Jan 31, 2024 · 2 comments
Closed

min vs minIdle #12

mattfysh opened this issue Jan 31, 2024 · 2 comments
Assignees
Labels

Comments

@mattfysh
Copy link

hey there, thanks for this brilliant library! i'm looking at the options and i guess not understanding the difference between min and minIdle, perhaps I thought all resources were idle if they were in the pool - can they be in other states?

@erayhanoglu
Copy link
Member

Hi,
The "min" option determines the minimum number of resources in the pool. These resources may be idle or active.
For example, min is 2. Pool starts with 2 idle resources. When you call acquire pool does nothing. So you have 2 resources now, 1 active 1 idle.

The "minIdle" option determines the minimum number of idle resources in the pool. For example, minIdle is 2. Pool starts with 2 idle resources. When you call acquire, a new resource is created immediately to keep minimum idle resouce count (2). So you have 3 resources now, 1 active 2 idle.

@mattfysh
Copy link
Author

Brilliant, thanks for the explanation!

@erayhanoglu erayhanoglu self-assigned this Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants