Documentation ¶
Index ¶
- Variables
- func Async[M any](process int, push func(chan M), logic func(M))
- func AsyncAlwaysUnique[M UniqueTask](process int, logic func(M)) chan M
- func AsyncAlwaysUniqueWithChan[M UniqueTask](c chan M, process int, logic func(M))
- func AsyncAlwaysWithChan[M any](process int, c chan M, logic func(M))
- func AsyncUnique[M UniqueTask](process int, push func(chan M), logic func(M))
- func Depth(key string) int
- func Lock(key string)
- func Ready(key string, max int)
- func Sync(key string, logic func() error) error
- func Unlock(key string)
- type Group
- type Pool
- type UniqueTask
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Wgp = sync.Pool{ New: func() interface{} { return &sync.WaitGroup{} }, } )
Functions ¶
func AsyncAlwaysUnique ¶
func AsyncAlwaysUnique[M UniqueTask](process int, logic func(M)) chan M
func AsyncAlwaysUniqueWithChan ¶
func AsyncAlwaysUniqueWithChan[M UniqueTask](c chan M, process int, logic func(M))
func AsyncAlwaysWithChan ¶
func AsyncUnique ¶
func AsyncUnique[M UniqueTask](process int, push func(chan M), logic func(M))
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) WaitAndExit ¶
func (p *Group) WaitAndExit()
type UniqueTask ¶
type UniqueTask interface {
UniqueKey() string
}
Click to show internal directories.
Click to hide internal directories.