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

Discard mode #4

Merged
merged 4 commits into from
Apr 9, 2023
Merged

Discard mode #4

merged 4 commits into from
Apr 9, 2023

Conversation

umputun
Copy link
Member

@umputun umputun commented Apr 9, 2023

Add the Discard option to both.SizedGroup and ErrSizedGroup. With this option, when the group is "locked" (i.e., over-capacity), any invocation of Go will be silently discarded until the group is unlocked (i.e., under-capacity). This allows for more efficient concurrency handling in scenarios where it's acceptable to skip the execution of additional goroutines when the group has reached its maximum capacity.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4648404867

  • 29 of 29 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.7%) to 94.805%

Totals Coverage Status
Change from base Build 4646752419: 0.7%
Covered Lines: 146
Relevant Lines: 154

💛 - Coveralls

@umputun umputun merged commit b4d22b8 into master Apr 9, 2023
2 checks passed
@umputun umputun deleted the discard-mode branch April 9, 2023 02:46
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.

None yet

2 participants