'Watches jobs currently in the monitor queue and deals with state
changes (queued to running) and job completion.'

def monitor(self):

    while True:
        try:
            while True:
                async_job_state = self.monitor_queue.get_nowait()
                if (async_job_state is STOP_SIGNAL):
                    self.handle_stop()
                    return
                self.watched.append(async_job_state)
        except Empty:
            pass
        try:
            self.check_watched_items()
        except Exception:
            log.exception('Unhandled    exception    checking    active    jobs')
        time.sleep(1)
