Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddToQueue ¶
func AddToQueue(job Job)
AddToQueue adds a job to the Queue * Call this with a pre-defined job to add it to the queue
func AsyncRun ¶
func AsyncRun(job Job)
AsyncRun attempts to execute a job asynchronously up to 3 times before giving up. It logs the time it took to execute the job and the number of attempts. It uses an exponential backoff strategy. This is a helper function that can be used to run any job asynchronously & is used to run both regular and irregular jobs.
func AsyncRunLimited ¶
func AsyncRunLimited(job Job)
AsyncRunLimited is a helper function that limits the number of concurrent jobs to the number of tokens in the semaphore. It's used to run irregular jobs. It's used to run irregular jobs.
func StartQueue ¶
func StartQueue()
StartQueue is the central controller for all irregularly scheduled jobs This function is meant to be called once at the start of the application and it will run in the background. It listens for jobs to be added to the queue and runs them asynchronously when they are added. It also listens for a shutdown signal and stops processing jobs when it receives it.
func StartSchedule ¶
func StartSchedule()
StartSchedule is the central controller for all regularly scheduled jobs in the application This one is manually configured to run jobs at specific times. It uses the cron package to do this. This function is meant to be called once at the start of the application and it will run in the background.