Documentation ¶
Overview ¶
Package limitgroup provides a sync.WaitGroup equivalent with a configurable upper bound. This is implemented by having Add() block as well if necessary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LimitGroup ¶
LimitGroup provides a WaitGroup with a limited upper bound. Once the limit is hit, Add will block until sufficient deltas are returned.
func NewLimitGroup ¶
func NewLimitGroup(limit uint) *LimitGroup
NewLimitGroup creates a new LimitGroup with the configured limit.
func (*LimitGroup) Add ¶
func (l *LimitGroup) Add(delta int)
Add adds delta, which may be negative. It will block if we have hit the limit, and will unblock as Done is called.
Click to show internal directories.
Click to hide internal directories.