Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultNapper ¶
DefaultNapper will sleep a minimum of 15 milliseconds per nap, but increasingly longer the more often workers go idle this ensures that idle workers do not take up too much cpu time, and should prevent accidental early exits
Types ¶
type JobTracker ¶
type JobTracker struct {
// contains filtered or unexported fields
}
func NewJobTracker ¶
func NewJobTracker(worker Worker, maxConcurrency int32, napper Napper) *JobTracker
func (*JobTracker) AddJob ¶
func (jt *JobTracker) AddJob(job string)
func (*JobTracker) AddJobs ¶
func (jt *JobTracker) AddJobs(jobs ...string)
func (*JobTracker) StartAndWait ¶
func (jt *JobTracker) StartAndWait(context Context, forceMaxConcurrency bool)
type Worker ¶
type Worker func(jt *JobTracker, job string, context Context)
Click to show internal directories.
Click to hide internal directories.