limitgroup: github.com/facebookgo/limitgroup Index | Files

package limitgroup

import "github.com/facebookgo/limitgroup"

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

Index

Package Files

limitgroup.go

type LimitGroup Uses

type LimitGroup struct {
    sync.WaitGroup
    // 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.