async.schedule
schedule(function, args = None, kwargs = None, run_after= None, meta = None, priority = 5, group = None)
Returns a Job instance that is used to record the task in the database. The job has a method execute
which will attempt to run the job. Don't do this directly until you've fully understood how transactions are handled
async.api.deschedule
deschedule(function, args = None, kwargs = None)
Marks all jobs in the queue that match the given function _and arguments_ as executed.
De-scheduling does not guarantee that the de-scheduled tasks will never run. This is because the task might have already started executing within the queue whilst it is de-scheduled from outside the queue.
Due to instabilities in the way that Python's JSON serialisation works it's not guaranteed that you will be able to deschedule jobs by matching the kwargs. If you are going to want to deschedule jobs then you should always use args for parameters.
async.api.health
info = health()
Returns a dict
containing basic information about the queue which can be used for monitoring.
async.api.remove_old_jobs
remove_old_jobs(remove_jobs_before_days=30, resched_hours=8)
Can be called to remove old executed and cancelled jobs from the queue as a form of garbage collection. Defaults to jobs that have been executed or cancelled more than 30 days previously, and it will default to rescheduling itself to run again eight hours later.