this is a batch processor for golang, it provide a simple way to process a batch of tasks.
The Go version needs to be greater than 1.18.
// initialize a batch processor
processor := NewBatchProcessor(ctx, paramsList, caller)
// set batch request num 10
processor.SetProcessNum(10)
// set process interval by 100ms
processor.SetInterval(100)
// set process concurrent count 10
processor.SetConcurrent(10)
// run processor
processor.Run()
// set interrupt func,when process once, it will call interruptFunc for check if need to interrupt
processor.SetInterruptFunc(interruptFunc)