master.lib.jobs package

Module contents

class master.lib.jobs.JobHandler(job, queue_name)[source]

Bases: object

A class to handle new jobs

drip(drip_size)[source]

Return items to be inserted into the queue. The drip_size is the total number in this drip. The amount yielded should be determined by the priority and the drip_size.

Num:The number of items to return
drop()[source]
class master.lib.jobs.JobManager(drip_size=10)[source]

Bases: threading.Thread

A class to manage jobs (starting/stopping/cancelling/etc)

AMQP_JOB_PROPS = {'exclusive': False, 'auto_delete': False, 'durable': True}
AMQP_JOB_QUEUE = 'jobs'
AMQP_JOB_STATUS_QUEUE = 'job_status'
cancel_job(job)[source]

Cancel the job job

Job:The job object to cancel
Returns:None
run()[source]

Run the job manager. Only one of these should ever be running at a time :returns: TODO

run_job(job)[source]

TODO: Docstring for run_job.

Job:TODO
Returns:TODO
stop()[source]

Stop the job manager :returns: TODO

stop_job(job)[source]

This is intended to be called once a job has been completed (not cancelled, but completed)