Files
go-zero/example/periodicalexecutor/pe.go

18 lines
281 B
Go
Raw Normal View History

2020-07-26 17:09:05 +08:00
package main
import (
"time"
2020-08-08 16:40:10 +08:00
"github.com/tal-tech/go-zero/core/executors"
2020-07-26 17:09:05 +08:00
)
func main() {
exeutor := executors.NewBulkExecutor(func(items []interface{}) {
println(len(items))
}, executors.WithBulkTasks(10))
for {
exeutor.Add(1)
time.Sleep(time.Millisecond * 90)
}
}