Versions in this module Expand all Collapse all v0 v0.14.0 Mar 22, 2025 Changes in this version + const DefaultConcurrentNum + func FetchAllPage(ctx context.Context, concurrency int, pageSize int, fetchFun FetchFunc) ([]interface{}, error) + func PageRequest(ctx context.Context, logName string, concurrency int, pageSize int, ...) ([]interface{}, error) + type FetchFunc func(ctx context.Context, pageSize, page int) (total int, list interface{}, err error) + type PageRequestFunc struct + PageResult func(items interface{}) (total int, currentPageLen int, err error) + RequestPage func(ctx context.Context, pageSize int, page int) (interface{}, error) + type ParallelOptions struct + ConcurrencyCount int + FailFast bool + type ParallelTasks struct + Log *zap.SugaredLogger + Options ParallelOptions + func P(log *zap.SugaredLogger, name string, tasks ...Task) *ParallelTasks + func (p *ParallelTasks) Add(tasks ...Task) *ParallelTasks + func (p *ParallelTasks) Cancel(cancelReason error) + func (p *ParallelTasks) Context(ctx context.Context) *ParallelTasks + func (p *ParallelTasks) Do() *ParallelTasks + func (p *ParallelTasks) FailFast() *ParallelTasks + func (p *ParallelTasks) Name(name string) *ParallelTasks + func (p *ParallelTasks) SetConcurrent(count int) *ParallelTasks + func (p *ParallelTasks) SetMaxConcurrent(count int, max int) *ParallelTasks + func (p *ParallelTasks) Wait() ([]interface{}, error) + type Task func() (interface{}, error)