Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNumWorkers ¶
func GetNumWorkers(j *JobManager) int
Types ¶
type JobManager ¶
type JobManager struct {
// contains filtered or unexported fields
}
func NewJobManager ¶
func NewJobManager(name string, numWorkers int, l log.Logger) *JobManager
NewJobManager creates a job manager, with an optional name
func (*JobManager) AddJob ¶
func (j *JobManager) AddJob(job Job, queueID string)
AddJob adds a job to the given queue, creating the queue if it doesn't exist
func (*JobManager) GetPendingJobCount ¶
func (j *JobManager) GetPendingJobCount() int
GetCurrentJobCount returns the total number of pending jobs in the job manager
func (*JobManager) GetWorkQueueLengths ¶
func (j *JobManager) GetWorkQueueLengths() map[string]int
GetWorkQueueLengths() returns a map of queue ID to number of active workers
func (*JobManager) GetWorkerCounts ¶
func (j *JobManager) GetWorkerCounts() map[string]int
GetWorkerCounts() returns a map of queue ID to number of active workers
func (*JobManager) Start ¶
func (j *JobManager) Start()
Start starts the job manager note: a given job manager cannot be restarted after it has been stopped
func (*JobManager) Stop ¶
func (j *JobManager) Stop()
Stop stops the job manager, and waits for the worker pool and job manager to quit gracefully
Click to show internal directories.
Click to hide internal directories.