MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / NewTaskGroup

Function NewTaskGroup

internal/goman/task_group.go:17–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15}
16
17func NewTaskGroup() *TaskGroup {
18 var concurrent = runtime.NumCPU()
19 if concurrent <= 1 {
20 concurrent = 2
21 }
22 return &TaskGroup{
23 semi: make(chan zero.Zero, concurrent),
24 wg: &sync.WaitGroup{},
25 locker: &sync.RWMutex{},
26 }
27}
28
29func (this *TaskGroup) Run(f func()) {
30 this.wg.Add(1)

Callers 12

CloseMethod · 0.92
TestNewTaskGroupFunction · 0.92
InitMethod · 0.92
CleanPrefixMethod · 0.92
CleanMatchKeyMethod · 0.92
CleanMatchPrefixMethod · 0.92
CleanAllMethod · 0.92
StatMethod · 0.92
CountMethod · 0.92
CloseMethod · 0.92
CloseMethod · 0.92
LoopMethod · 0.92

Calls

no outgoing calls

Tested by 1

TestNewTaskGroupFunction · 0.74