Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
Init initializes the jobs queue and the jobs database tables (if they do not yet exist). It must be called before any other functions in this package and must not called concurrently with any other functions in this package.
func Job ¶
Job returns information about the job with the given id. If the job cannot be found or if any other error occurs, a job with db.StatusFailed is returned.
func Run ¶ added in v0.5.2
Run executes a command with the given context and arguments. The command's stderr is logged using log.Debug. Run waits for the command to finish and returns its result.
func Start ¶
Start runs the given callback function as a background job. It starts the job in the background and immediately returns the job id without blocking. If a job for the given book is already running, this job's id information is returned. You can check the status of the job with the Job function at any given time.