mirror of
https://gitee.com/johng/gf.git
synced 2024-12-03 04:37:49 +08:00
21 lines
245 B
Go
21 lines
245 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
|
|
"github.com/gogf/gf/os/grpool"
|
|
)
|
|
|
|
func main() {
|
|
p := grpool.New(1)
|
|
for i := 0; i < 10; i++ {
|
|
v := i
|
|
p.Add(func() {
|
|
fmt.Println(v)
|
|
time.Sleep(3 * time.Second)
|
|
})
|
|
}
|
|
time.Sleep(time.Minute)
|
|
}
|