Skip to content

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

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

Merged
merged 2 commits into from
Feb 17, 2025

Conversation

alitto
Copy link
Owner

@alitto alitto commented Feb 16, 2025

  • 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).
  • 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.
  • Simplify pool submission logic and remove dispatcher goroutine.
  • Simplify subpool implementation.

@alitto alitto force-pushed the feat/AD/bounded-queue-v2 branch 2 times, most recently from 84cf344 to 37c008b Compare February 16, 2025 15:20
@alitto alitto force-pushed the feat/AD/bounded-queue-v2 branch from 37c008b to f6bb0e9 Compare February 16, 2025 15:21
Copy link

codecov bot commented Feb 16, 2025

Codecov Report

Attention: Patch coverage is 91.79688% with 21 lines in your changes missing coverage. Please review.

Project coverage is 94.62%. Comparing base (dfb31e5) to head (aca653d).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pool.go 92.47% 13 Missing and 1 partial ⚠️
internal/linkedbuffer/linkedbuffer.go 87.17% 4 Missing and 1 partial ⚠️
internal/linkedbuffer/buffer.go 86.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #99      +/-   ##
==========================================
- Coverage   96.15%   94.62%   -1.54%     
==========================================
  Files          14       11       -3     
  Lines         858      688     -170     
==========================================
- Hits          825      651     -174     
- Misses         30       34       +4     
  Partials        3        3              

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

@alitto alitto force-pushed the feat/AD/bounded-queue-v2 branch 4 times, most recently from e65173d to fc6bfd9 Compare February 17, 2025 00:14
@alitto alitto force-pushed the feat/AD/bounded-queue-v2 branch from fc6bfd9 to aca653d Compare February 17, 2025 00:22
@alitto alitto merged commit e2fee68 into main Feb 17, 2025
15 checks passed
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