go-pkgz / syncs

Concurrency and synchronization primitives
https://go-pkgz.umputun.dev/syncs/
MIT License
136 stars 13 forks source link

Discard mode #4

Closed umputun closed 1 year ago

umputun commented 1 year ago

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 commented 1 year ago

Pull Request Test Coverage Report for Build 4648404867


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

💛 - Coveralls