mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-24 18:00:24 +08:00
19 lines
294 B
Go
19 lines
294 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
|
|
"github.com/tal-tech/go-zero/core/executors"
|
|
)
|
|
|
|
func main() {
|
|
executor := executors.NewBulkExecutor(func(items []interface{}) {
|
|
fmt.Println(len(items))
|
|
}, executors.WithBulkTasks(10))
|
|
for {
|
|
executor.Add(1)
|
|
time.Sleep(time.Millisecond * 90)
|
|
}
|
|
}
|