mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-13 09:50:00 +08:00
initial import
This commit is contained in:
11
core/fx/parallel.go
Normal file
11
core/fx/parallel.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package fx
|
||||
|
||||
import "zero/core/threading"
|
||||
|
||||
func Parallel(fns ...func()) {
|
||||
group := threading.NewRoutineGroup()
|
||||
for _, fn := range fns {
|
||||
group.RunSafe(fn)
|
||||
}
|
||||
group.Wait()
|
||||
}
|
||||
Reference in New Issue
Block a user