limitgroup: Index | Files

package limitgroup

import ""

Package limitgroup provides a sync.WaitGroup equivalent with a configurable upper bound. This is implemented by having Add() block as well if necessary.


Package Files


type LimitGroup Uses

type LimitGroup struct {
    // contains filtered or unexported fields

LimitGroup provides a WaitGroup with a limited upper bound. Once the limit is hit, Add will block until sufficient deltas are returned.

func NewLimitGroup Uses

func NewLimitGroup(limit uint) *LimitGroup

NewLimitGroup creates a new LimitGroup with the configured limit.

func (*LimitGroup) Add Uses

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.

func (*LimitGroup) Done Uses

func (l *LimitGroup) Done()

Done decrements the counter.

Package limitgroup imports 1 packages (graph) and is imported by 1 packages. Updated 2016-11-22. Refresh now. Tools for package owners.