Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JobData ¶
type JobData struct { URL string Tags []string ParentPlaylistID string ParentPlaylistExtractor string }
JobData contains the arguments to begin processing our job
type JobFailure ¶
type JobFailure struct {
Error error
}
JobFailure is the reason why we couldn't process a job
type JobProgress ¶ added in v0.0.3
type JobProgress string
JobProgress describes the current state of the job
type OnFailedHandler ¶
type OnFailedHandler func(id JobID, data JobData, failures []JobFailure)
An OnFailedHandler is called when a job is unable to finish successfully
type OnFinishedHandler ¶
An OnFinishedHandler is called when a job finishes successfully
type OnProgressHandler ¶ added in v0.0.3
type OnProgressHandler func(id JobID, data JobData, progress JobProgress)
An OnProgressHandler is called every time a job progresses
type OnQueuedHandler ¶
An OnQueuedHandler is called when a job is pushed to the queue
type OnStartedHandler ¶
An OnStartedHandler is called when a job is started for the first time
type Queue ¶
type Queue interface { OnQueued(handler OnQueuedHandler) OnStarted(handler OnStartedHandler) OnProgress(handler OnProgressHandler) OnFinished(handler OnFinishedHandler) OnFailed(handler OnFailedHandler) Push(id JobID, data JobData) Pull(ctx context.Context) QueuedJob }
A Queue handles your jobs
func MakeBarebonesQueue ¶
func MakeBarebonesQueue() Queue
MakeBarebonesQueue returns a perfectly valid and working Queue instance :^)
type QueuedJob ¶
type QueuedJob interface { ID() JobID Data() *JobData Progress(progress JobProgress) Finished(result *JobResult) Failed(failure *JobFailure) }
A QueuedJob is something we have to do... eventually