Documentation ¶
Index ¶
- func GenerateJobUID() (id string)
- type Job
- type JobError
- type JobPool
- func (jp *JobPool) GetJobFromJobId(jobId string) (j *Job, err error)
- func (jp *JobPool) ListWaitingJobs() (jobList string)
- func (jp *JobPool) ListenForShutdown()
- func (jp *JobPool) ProcessJobs()
- func (jp *JobPool) QueueJob(id string, jobName string, jobRunner JobRunner, poolNumber int) (job *Job)
- func (jp *JobPool) ShutdownWorkPool()
- func (jp *JobPool) Start()
- type JobQueue
- type JobRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Job ¶
type Job struct { JobRunner `json:"-"` //skip the field for json Id string `json:"id"` Name string `json:"name"` //Public property retrievable Status string `json:"status"` //Status of the current job Error *JobError `json:"-"` Start time.Time `json:"start"` End time.Time `json:"end"` }
Job
func (*Job) GetJobError ¶
create an error well formated
func (*Job) GetJobInfos ¶
func (*Job) GetJobName ¶
func (*Job) GetJobStatus ¶
func (*Job) HasJobErrored ¶
type JobError ¶
type JobError struct { ErrorString string //error as a string // contains filtered or unexported fields }
Error handling structure
func NewJobError ¶
type JobPool ¶
type JobPool struct {
// contains filtered or unexported fields
}
JobPool principal s²tructure maintaining queues of jobs from a priority range
func (*JobPool) GetJobFromJobId ¶
func (*JobPool) ListWaitingJobs ¶
List current waiting jobs in each queues
func (*JobPool) ListenForShutdown ¶
func (jp *JobPool) ListenForShutdown()
Stop the jobPool and release all memory allowed NYI
func (*JobPool) ProcessJobs ¶
func (jp *JobPool) ProcessJobs()
Loop for processing jobs Started at the creation of the pool
func (*JobPool) QueueJob ¶
func (jp *JobPool) QueueJob(id string, jobName string, jobRunner JobRunner, poolNumber int) (job *Job)
Queue new job to currentJobPool taking on
func (*JobPool) ShutdownWorkPool ¶
func (jp *JobPool) ShutdownWorkPool()
type JobQueue ¶
type JobQueue struct { Jobs *list.List `json:"jobsWaiting"` //list of waiting jobs // contains filtered or unexported fields }
JobQueue is structure to control jobs queues
func (*JobQueue) GetJobFromJobId ¶
func (*JobQueue) GetJobsWaiting ¶
Click to show internal directories.
Click to hide internal directories.