parallel.go 199 B

1234567891011
  1. package fx
  2. import "github.com/tal-tech/go-zero/core/threading"
  3. func Parallel(fns ...func()) {
  4. group := threading.NewRoutineGroup()
  5. for _, fn := range fns {
  6. group.RunSafe(fn)
  7. }
  8. group.Wait()
  9. }