-
Notifications
You must be signed in to change notification settings - Fork 338
Open
Description
Sometimes there are cases, when goroutines states should be printed in console.
Similar functionality: hmdsefi/gowl
Usage proposal:
p := pool.New().WithMaxGoroutines(10).WithMonitor(monitor, time.Second)
p.Go(func(tp *threadParameter) (res interface{}, err error) {
tp.setState("Doing work1...")
err = work1()
tp.setState("Doing work2...")
res, err = work2()
return
})
func monitor(ts []*threadState) error {
return fmt.Fprintf(os.Stderr, "Thread states: %v", ts);
}
Metadata
Metadata
Assignees
Labels
No labels