ants icon indicating copy to clipboard operation
ants copied to clipboard

feat: add WithMinWorkers option

Open Jagerente opened this issue 8 months ago β€’ 3 comments

1. Are you opening this pull request for bug-fixs, optimizations or new feature?

New feature

2. Please describe how these code changes achieve your intention.

Added a new option WithMinWorkers(n) so the pool never drops below n idle workers when purging.

3. Please link to the relevant issues (if any).

n/a

4. Which documentation changes (if any) need to be made/updated because of this PR?

It's already contains generic Options reference to godoc

4. Checklist

  • [x] I have squashed all insignificant commits.
  • [x] I have commented my code for explaining package types, values, functions, and non-obvious lines.
  • [x] I have written unit tests and verified that all tests passes (if needed).
  • [x] I have documented feature info on the README (only when this PR is adding a new feature).
  • [x] (optional) I am willing to help maintain this change if there are issues with it later.

Jagerente avatar May 09 '25 17:05 Jagerente

Why do you need this? What use cases can benefit from this?

panjf2000 avatar May 10 '25 01:05 panjf2000

To avoid power spikes in normal/predicted highload scenarios while still having a room for unexpected bursts.

Jagerente avatar May 10 '25 07:05 Jagerente

This PR is marked as stale because it has been open for 21 days with no activity.

You should take one of the following actions:

  • Manually close this PR if it is no longer relevant
  • Push new commits or comment if you have more information to share

This PR will be automatically closed in 7 days if no further activity occurs.

github-actions[bot] avatar Jun 01 '25 00:06 github-actions[bot]

This PR was closed because it has been inactive for 7 days since being marked as stale.

If you believe this is a false alarm, feel free to reopen this PR or create a new one.

github-actions[bot] avatar Jun 09 '25 00:06 github-actions[bot]