arthur/scheduler.py
def schedule_job_task(self, queue_id, task_id, job_args, delay=0):
        """Schedule a job in the given queue."""

        self._rwlock.writer_acquire()

        job_id = self._generate_job_id(task_id)

        event = self._scheduler.enter(delay, 1, self._enqueue_job,
                                      argument=(queue_id, job_id, job_args,))
        self._jobs[job_id] = event
        self._tasks[task_id] = job_id

        self._rwlock.writer_release()

        logging.debug("Job #%s (task: %s) scheduled on %s (wait: %s)",
                      job_id, task_id, queue_id, delay)

        return job_id
def schedule_job_task(self, queue_id, task_id, job_args, delay=0):
        """Schedule a job in the given queue."""

        self._rwlock.writer_acquire()

        job_id = self._generate_job_id(task_id)

        event = self._scheduler.enter(delay, 1, self._enqueue_job,
                                      argument=(queue_id, job_id, job_args,))
        self._jobs[job_id] = event
        self._tasks[task_id] = job_id

        self._rwlock.writer_release()

        logging.debug("Job #%s (task: %s) scheduled on %s (wait: %s)",
                      job_id, task_id, queue_id, delay)

        return job_id
Schedule a job in the given queue.