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

feat(pool): add option to bound task queue #95

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alitto
Copy link
Owner

@alitto alitto commented Dec 24, 2024

  • Add support to create bounded pools by specifying a queue size (WithQueueSize option).
  • Add support to choose how to deal with tasks submitted when the queue is full (WithNonBlocking option).
  • Create custom implementation of a semaphore and refactor subpools to use it.
  • Bump minimum supported go version to 1.21 since the semaphore package requires context.AfterFunc.
  • Ensure RunningWorkers() method in subpools reflect the actual number of workers running tasks belonging to the subpool.
  • Allow overriding pool options when creating a subpool via NewSupool.

@alitto alitto force-pushed the feat/AD/bounded-queue branch 2 times, most recently from 43ce73c to ae85226 Compare December 24, 2024 14:19
Copy link

codecov bot commented Dec 24, 2024

Codecov Report

Attention: Patch coverage is 87.72727% with 27 lines in your changes missing coverage. Please review.

Project coverage is 93.87%. Comparing base (ac7c6a3) to head (20335af).

Files with missing lines Patch % Lines
resultsubpool.go 46.15% 16 Missing and 5 partials ⚠️
pool.go 84.61% 3 Missing and 1 partial ⚠️
internal/linkedbuffer/linkedbuffer.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #95      +/-   ##
==========================================
- Coverage   95.32%   93.87%   -1.46%     
==========================================
  Files          14       15       +1     
  Lines         855     1028     +173     
==========================================
+ Hits          815      965     +150     
- Misses         36       52      +16     
- Partials        4       11       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alitto alitto force-pushed the feat/AD/bounded-queue branch 2 times, most recently from d28e995 to b0b8d1f Compare December 24, 2024 14:48
@alitto alitto force-pushed the feat/AD/bounded-queue branch from b0b8d1f to 20335af Compare December 24, 2024 14:49
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

Successfully merging this pull request may close these issues.

1 participant