'Get jobs from the queue and perform them as they arrive.'

def run(self):

    while 1:
        job = self.jobs.get()
        try:
            job.run()
        except workerpool.exceptions.TerminationNotice:
            break
        except Exception as e:
            tb_msg = traceback.format_exc()
            jid = (job.jobid or str(thread.get_ident()))
            self.jobs.store_exception([e, tb_msg, jid])
        finally:
            self.jobs.task_done()
