sdns: github.com/semihalev/sdns/waitgroup Index | Files

package waitgroup

import "github.com/semihalev/sdns/waitgroup"

Index

Package Files

waitgroup.go

type WaitGroup Uses

type WaitGroup struct {
    // contains filtered or unexported fields
}

WaitGroup waits for other same processes based key with timeout.

func New Uses

func New(timeout time.Duration) *WaitGroup

New return a new WaitGroup with timeout.

func (*WaitGroup) Add Uses

func (wg *WaitGroup) Add(key uint64)

Add adds a new caller or if the caller exists increment dups with key.

func (*WaitGroup) Done Uses

func (wg *WaitGroup) Done(key uint64)

Done cancels the group context or if the caller dups more then zero, decrements the dups with key.

func (*WaitGroup) Get Uses

func (wg *WaitGroup) Get(key uint64) int

Get return count of dups with key.

func (*WaitGroup) Wait Uses

func (wg *WaitGroup) Wait(key uint64)

Wait blocks until WaitGroup context cancelled or timedout with key.

Package waitgroup imports 3 packages (graph). Updated 2020-10-28. Refresh now. Tools for package owners.