Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Idle is the status of an idle job Idle Status = iota // Scheduled is the status of a job that has been scheduled Scheduled = iota // Active is the status of a job that is currently being processed Active = iota // Completed is the status of a job that completed successfully Completed = iota // Failed is the status of a job that completed unsuccessfully Failed = iota )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { // Name is a human-readable name of the job. Name string // Description is a human-readable description for the job. Description string // Tries is the current number of performed tries Tries uint // MaximumTries is the maximum number of tries before ignoring the job. MaximumTries uint // Status is the current status of the job. Status Status // JobCompletedCallback is called with the resulting record whenever a job is completed. JobCompletedCallback JobCompletedCallback // JobFailedCallback is called with the error whenver a job fails. JobFailedCallback JobFailedCallback // PerformJobCallback is called whenever the job is performed. PerformJobCallback PerformJobCallback // contains filtered or unexported fields }
Job is a job to produce a WARC record.
func NewJob ¶
func NewJob(name string, description string, handler JobHandler) *Job
NewJob creates a new job with default settings.
type JobCompletedCallback ¶
JobCompletedCallback is called with the resulting record whenever a job is completed.
type JobFailedCallback ¶
JobFailedCallback is called with the error whenver a job fails.
type JobHandler ¶
JobHandler is the function invoked to perform the job. May return nil or one or more records.
type PerformJobCallback ¶
type PerformJobCallback func(job *Job)
PerformJobCallback is called whenever the job is performed.
type Pool ¶
Pool is a worker pool.
Click to show internal directories.
Click to hide internal directories.