package
Version:
v1.0.9
Opens a new window with list of versions in this module.
Published: Nov 30, 2023
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
func PoolJobs(jobs []Job, concurrency int, stopOnErr bool, retHandler func(job Job, ret interface{}, err error))
PoolJobs execute jobs concurrently with limited concurrency, you can stop on error or ignore errors and proceed on.
func PoolJobsEx(jobs chan Job, maxConcurrency int, stopOnErr bool, retHandler func(job Job, ret interface{}, err error))
PoolJobsEx get job from channel instead of predefined jobs, jobs channel should be close when no more jobs.
type Job interface {
Run() (ret interface{}, err error)
}
Job abstract a job which can be executed by PoolJobs.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.