diff --git a/__init__.py b/__init__.py index 96b8c9e..c125891 100644 --- a/__init__.py +++ b/__init__.py @@ -20,7 +20,7 @@ class DelayedResult(object): return self._rv -class task(object): +class job(object): def __init__(self, queue='normal'): self.queue = queue diff --git a/worker.py b/worker.py index 4745642..eee1c0d 100644 --- a/worker.py +++ b/worker.py @@ -44,9 +44,9 @@ class Worker(object): while True: self.procline('Waiting on %s' % (', '.join(self.queue_names),)) queue, msg = conn.blpop(self.queue_keys) - self.fork_and_perform_task(queue, msg) + self.fork_and_perform_job(queue, msg) - def fork_and_perform_task(self, queue, msg): + def fork_and_perform_job(self, queue, msg): child_pid = os.fork() if child_pid == 0: random.seed() @@ -54,7 +54,7 @@ class Worker(object): try: self.procline('Processing work since %d' % (time.time(),)) self._working = True - self.perform_task(queue, msg) + self.perform_job(queue, msg) except Exception, e: self.log.exception(e) sys.exit(1) @@ -64,7 +64,7 @@ class Worker(object): os.waitpid(child_pid, 0) self._working = False - def perform_task(self, queue, msg): + def perform_job(self, queue, msg): func, key, args, kwargs = loads(msg) self.procline('Processing %s from %s since %s' % (func.__name__, queue, time.time())) try: