Browse Source

TaskSetResult renamed -> GroupResult

Ask Solem 12 years ago
parent
commit
66a8a9833c

+ 4 - 4
Changelog

@@ -3296,7 +3296,7 @@ News
 * New user guides:
 
     * :doc:`userguide/workers`
-    * :doc:`userguide/tasksets`
+    * :doc:`userguide/canvas`
     * :doc:`userguide/routing`
 
 * celeryd: Standard out/error is now being redirected to the log file.
@@ -3343,14 +3343,14 @@ News
     See issue #122.
 
 * New built-in way to do task callbacks using
-  :class:`~celery.task.sets.subtask`.
+  :class:`~celery.subtask`.
 
-  See :doc:`userguide/tasksets` for more information.
+  See :doc:`userguide/canvas` for more information.
 
 * TaskSets can now contain several types of tasks.
 
   :class:`~celery.task.sets.TaskSet` has been refactored to use
-  a new syntax, please see :doc:`userguide/tasksets` for more information.
+  a new syntax, please see :doc:`userguide/canvas` for more information.
 
   The previous syntax is still supported, but will be deprecated in
   version 1.4.

+ 5 - 3
celery/app/amqp.py

@@ -152,7 +152,8 @@ class TaskProducer(Producer):
         super(TaskProducer, self).__init__(channel, exchange, *args, **kwargs)
 
     def delay_task(self, task_name, task_args=None, task_kwargs=None,
-            countdown=None, eta=None, task_id=None, taskset_id=None,
+            countdown=None, eta=None, task_id=None, group_id=None,
+            taskset_id=None,  # compat alias to group_id
             expires=None, exchange=None, exchange_type=None,
             event_dispatcher=None, retry=None, retry_policy=None,
             queue=None, now=None, retries=0, chord=None, callbacks=None,
@@ -189,8 +190,9 @@ class TaskProducer(Producer):
                 "utc": self.utc,
                 "callbacks": callbacks,
                 "errbacks": errbacks}
-        if taskset_id:
-            body["taskset"] = taskset_id
+        group_id = group_id or taskset_id
+        if group_id:
+            body["taskset"] = group_id
         if chord:
             body["chord"] = chord
 

+ 5 - 1
celery/app/base.py

@@ -380,7 +380,11 @@ class Celery(object):
         return self.subclass_with_self("celery.result:AsyncResult")
 
     @cached_property
-    def TaskSetResult(self):
+    def GroupResult(self):
+        return self.subclass_with_self("celery.result:GroupResult")
+
+    @cached_property
+    def TaskSetResult(self):  # XXX compat
         return self.subclass_with_self("celery.result:TaskSetResult")
 
     @property

+ 17 - 17
celery/app/builtins.py

@@ -62,9 +62,9 @@ def add_unlock_chord_task(app):
     from celery import result as _res
 
     @app.task(name="celery.chord_unlock", max_retries=None)
-    def unlock_chord(setid, callback, interval=1, propagate=False,
+    def unlock_chord(group_id, callback, interval=1, propagate=False,
             max_retries=None, result=None):
-        result = _res.TaskSetResult(setid, map(_res.AsyncResult, result))
+        result = _res.GroupResult(group_id, map(_res.AsyncResult, result))
         j = result.join_native if result.supports_native_join else result.join
         if result.ready():
             subtask(callback).delay(j(propagate=propagate))
@@ -113,15 +113,15 @@ def add_group_task(app):
         name = "celery.group"
         accept_magic_kwargs = False
 
-        def run(self, tasks, result, setid):
+        def run(self, tasks, result, group_id):
             app = self.app
             result = from_serializable(result)
             if self.request.is_eager or app.conf.CELERY_ALWAYS_EAGER:
-                return app.TaskSetResult(result.id,
-                        [subtask(task).apply(taskset_id=setid)
+                return app.GroupResult(result.id,
+                        [subtask(task).apply(group_id=group_id)
                             for task in tasks])
             with app.default_producer() as pub:
-                [subtask(task).apply_async(taskset_id=setid, publisher=pub,
+                [subtask(task).apply_async(group_id=group_id, publisher=pub,
                                            add_to_parent=False)
                         for task in tasks]
             parent = get_current_worker_task()
@@ -131,17 +131,17 @@ def add_group_task(app):
 
         def prepare(self, options, tasks, **kwargs):
             r = []
-            options["taskset_id"] = group_id = \
+            options["group_id"] = group_id = \
                     options.setdefault("task_id", uuid())
             for task in tasks:
                 opts = task.options
-                opts["taskset_id"] = group_id
+                opts["group_id"] = group_id
                 try:
                     tid = opts["task_id"]
                 except KeyError:
                     tid = opts["task_id"] = uuid()
                 r.append(self.AsyncResult(tid))
-            return tasks, self.app.TaskSetResult(group_id, r), group_id
+            return tasks, self.app.GroupResult(group_id, r), group_id
 
         def apply_async(self, args=(), kwargs={}, **options):
             if self.app.conf.CELERY_ALWAYS_EAGER:
@@ -171,7 +171,7 @@ def add_chain_task(app):
             if self.app.conf.CELERY_ALWAYS_EAGER:
                 return self.apply(args, kwargs, **options)
             options.pop("publisher", None)
-            taskset_id = options.pop("taskset_id", None)
+            group_id = options.pop("group_id", None)
             chord = options.pop("chord", None)
             tasks = [maybe_subtask(t).clone(
                         task_id=options.pop("task_id", uuid()),
@@ -179,8 +179,8 @@ def add_chain_task(app):
                     )
                     for t in kwargs["tasks"]]
             reduce(lambda a, b: a.link(b), tasks)
-            if taskset_id:
-                tasks[-1].set(taskset_id=taskset_id)
+            if group_id:
+                tasks[-1].set(group_id=group_id)
             if chord:
                 tasks[-1].set(chord=chord)
             tasks[0].apply_async()
@@ -220,7 +220,7 @@ def add_chord_task(app):
             if not isinstance(header, group):
                 header = group(header)
             r = []
-            setid = uuid()
+            group_id = uuid()
             for task in header.tasks:
                 opts = task.options
                 try:
@@ -228,16 +228,16 @@ def add_chord_task(app):
                 except KeyError:
                     tid = opts["task_id"] = uuid()
                 opts["chord"] = body
-                opts["taskset_id"] = setid
+                opts["group_id"] = group_id
                 r.append(app.AsyncResult(tid))
             if eager:
-                return header.apply(task_id=setid)
-            app.backend.on_chord_apply(setid, body,
+                return header.apply(task_id=group_id)
+            app.backend.on_chord_apply(group_id, body,
                                        interval=interval,
                                        max_retries=max_retries,
                                        propagate=propagate,
                                        result=r)
-            return header(task_id=setid)
+            return header(task_id=group_id)
 
         def apply_async(self, args=(), kwargs={}, task_id=None, **options):
             if self.app.conf.CELERY_ALWAYS_EAGER:

+ 2 - 1
celery/app/task.py

@@ -58,7 +58,8 @@ class Context(object):
     retries = 0
     is_eager = False
     delivery_info = None
-    taskset = None
+    taskset = None   # compat alias to group
+    group = None
     chord = None
     called_directly = True
     callbacks = None

+ 9 - 9
celery/backends/amqp.py

@@ -212,22 +212,22 @@ class AMQPBackend(BaseDictBackend):
         raise NotImplementedError(
                 "reload_task_result is not supported by this backend.")
 
-    def reload_taskset_result(self, task_id):
-        """Reload taskset result, even if it has been previously fetched."""
+    def reload_group_result(self, task_id):
+        """Reload group result, even if it has been previously fetched."""
         raise NotImplementedError(
-                "reload_taskset_result is not supported by this backend.")
+                "reload_group_result is not supported by this backend.")
 
-    def save_taskset(self, taskset_id, result):
+    def save_group(self, group_id, result):
         raise NotImplementedError(
-                "save_taskset is not supported by this backend.")
+                "save_group is not supported by this backend.")
 
-    def restore_taskset(self, taskset_id, cache=True):
+    def restore_group(self, group_id, cache=True):
         raise NotImplementedError(
-                "restore_taskset is not supported by this backend.")
+                "restore_group is not supported by this backend.")
 
-    def delete_taskset(self, taskset_id):
+    def delete_group(self, group_id):
         raise NotImplementedError(
-                "delete_taskset is not supported by this backend.")
+                "delete_group is not supported by this backend.")
 
     def __reduce__(self, args=(), kwargs={}):
         kwargs.update(connection=self._connection,

+ 50 - 50
celery/backends/base.py

@@ -187,36 +187,36 @@ class BaseBackend(object):
         raise NotImplementedError(
                 "get_traceback is not supported by this backend.")
 
-    def save_taskset(self, taskset_id, result):
+    def save_group(self, group_id, result):
         """Store the result and status of a task."""
         raise NotImplementedError(
-                "save_taskset is not supported by this backend.")
+                "save_group is not supported by this backend.")
 
-    def restore_taskset(self, taskset_id, cache=True):
-        """Get the result of a taskset."""
+    def restore_group(self, group_id, cache=True):
+        """Get the result of a group."""
         raise NotImplementedError(
-                "restore_taskset is not supported by this backend.")
+                "restore_group is not supported by this backend.")
 
-    def delete_taskset(self, taskset_id):
+    def delete_group(self, group_id):
         raise NotImplementedError(
-                "delete_taskset is not supported by this backend.")
+                "delete_group is not supported by this backend.")
 
     def reload_task_result(self, task_id):
         """Reload task result, even if it has been previously fetched."""
         raise NotImplementedError(
                 "reload_task_result is not supported by this backend.")
 
-    def reload_taskset_result(self, task_id):
-        """Reload taskset result, even if it has been previously fetched."""
+    def reload_group_result(self, task_id):
+        """Reload group result, even if it has been previously fetched."""
         raise NotImplementedError(
-                "reload_taskset_result is not supported by this backend.")
+                "reload_group_result is not supported by this backend.")
 
     def on_chord_part_return(self, task, propagate=False):
         pass
 
-    def fallback_chord_unlock(self, setid, body, result=None, **kwargs):
+    def fallback_chord_unlock(self, group_id, body, result=None, **kwargs):
         kwargs["result"] = [r.id for r in result]
-        self.app.tasks["celery.chord_unlock"].apply_async((setid, body, ),
+        self.app.tasks["celery.chord_unlock"].apply_async((group_id, body, ),
                                                           kwargs, countdown=1)
     on_chord_apply = fallback_chord_unlock
 
@@ -287,40 +287,40 @@ class BaseDictBackend(BaseBackend):
     def reload_task_result(self, task_id):
         self._cache[task_id] = self.get_task_meta(task_id, cache=False)
 
-    def reload_taskset_result(self, taskset_id):
-        self._cache[taskset_id] = self.get_taskset_meta(taskset_id,
-                                                        cache=False)
+    def reload_group_result(self, group_id):
+        self._cache[group_id] = self.get_group_meta(group_id,
+                                                    cache=False)
 
-    def get_taskset_meta(self, taskset_id, cache=True):
+    def get_group_meta(self, group_id, cache=True):
         if cache:
             try:
-                return self._cache[taskset_id]
+                return self._cache[group_id]
             except KeyError:
                 pass
 
-        meta = self._restore_taskset(taskset_id)
+        meta = self._restore_group(group_id)
         if cache and meta is not None:
-            self._cache[taskset_id] = meta
+            self._cache[group_id] = meta
         return meta
 
-    def restore_taskset(self, taskset_id, cache=True):
-        """Get the result for a taskset."""
-        meta = self.get_taskset_meta(taskset_id, cache=cache)
+    def restore_group(self, group_id, cache=True):
+        """Get the result for a group."""
+        meta = self.get_group_meta(group_id, cache=cache)
         if meta:
             return meta["result"]
 
-    def save_taskset(self, taskset_id, result):
-        """Store the result of an executed taskset."""
-        return self._save_taskset(taskset_id, result)
+    def save_group(self, group_id, result):
+        """Store the result of an executed group."""
+        return self._save_group(group_id, result)
 
-    def delete_taskset(self, taskset_id):
-        self._cache.pop(taskset_id, None)
-        return self._delete_taskset(taskset_id)
+    def delete_group(self, group_id):
+        self._cache.pop(group_id, None)
+        return self._delete_group(group_id)
 
 
 class KeyValueStoreBackend(BaseDictBackend):
     task_keyprefix = ensure_bytes("celery-task-meta-")
-    taskset_keyprefix = ensure_bytes("celery-taskset-meta-")
+    group_keyprefix = ensure_bytes("celery-taskset-meta-")
     chord_keyprefix = ensure_bytes("chord-unlock-")
     implements_incr = False
 
@@ -346,18 +346,18 @@ class KeyValueStoreBackend(BaseDictBackend):
         """Get the cache key for a task by id."""
         return self.task_keyprefix + ensure_bytes(task_id)
 
-    def get_key_for_taskset(self, taskset_id):
-        """Get the cache key for a taskset by id."""
-        return self.taskset_keyprefix + ensure_bytes(taskset_id)
+    def get_key_for_group(self, group_id):
+        """Get the cache key for a group by id."""
+        return self.group_keyprefix + ensure_bytes(group_id)
 
-    def get_key_for_chord(self, taskset_id):
-        """Get the cache key for the chord waiting on taskset with given id."""
-        return self.chord_keyprefix + ensure_bytes(taskset_id)
+    def get_key_for_chord(self, group_id):
+        """Get the cache key for the chord waiting on group with given id."""
+        return self.chord_keyprefix + ensure_bytes(group_id)
 
     def _strip_prefix(self, key):
         """Takes bytes, emits string."""
         key = ensure_bytes(key)
-        for prefix in self.task_keyprefix, self.taskset_keyprefix:
+        for prefix in self.task_keyprefix, self.group_keyprefix:
             if key.startswith(prefix):
                 return bytes_to_str(key[len(prefix):])
         return bytes_to_str(key)
@@ -411,13 +411,13 @@ class KeyValueStoreBackend(BaseDictBackend):
         self.set(self.get_key_for_task(task_id), self.encode(meta))
         return result
 
-    def _save_taskset(self, taskset_id, result):
-        self.set(self.get_key_for_taskset(taskset_id),
+    def _save_group(self, group_id, result):
+        self.set(self.get_key_for_group(group_id),
                  self.encode({"result": result.serializable()}))
         return result
 
-    def _delete_taskset(self, taskset_id):
-        self.delete(self.get_key_for_taskset(taskset_id))
+    def _delete_group(self, group_id):
+        self.delete(self.get_key_for_group(group_id))
 
     def _get_task_meta_for(self, task_id):
         """Get task metadata for a task by id."""
@@ -426,9 +426,9 @@ class KeyValueStoreBackend(BaseDictBackend):
             return {"status": states.PENDING, "result": None}
         return self.decode(meta)
 
-    def _restore_taskset(self, taskset_id):
+    def _restore_group(self, group_id):
         """Get task metadata for a task by id."""
-        meta = self.get(self.get_key_for_taskset(taskset_id))
+        meta = self.get(self.get_key_for_group(group_id))
         # previously this was always pickled, but later this
         # was extended to support other serializers, so the
         # structure is kind of weird.
@@ -439,22 +439,22 @@ class KeyValueStoreBackend(BaseDictBackend):
                 return {"result": from_serializable(result)}
             return meta
 
-    def on_chord_apply(self, setid, body, result=None, **kwargs):
+    def on_chord_apply(self, group_id, body, result=None, **kwargs):
         if self.implements_incr:
-            self.app.TaskSetResult(setid, result).save()
+            self.app.GroupResult(group_id, result).save()
         else:
-            self.fallback_chord_unlock(setid, body, result, **kwargs)
+            self.fallback_chord_unlock(group_id, body, result, **kwargs)
 
     def on_chord_part_return(self, task, propagate=False):
         if not self.implements_incr:
             return
         from celery import subtask
-        from celery.result import TaskSetResult
-        setid = task.request.taskset
-        if not setid:
+        from celery.result import GroupResult
+        gid = task.request.group
+        if not gid:
             return
-        key = self.get_key_for_chord(setid)
-        deps = TaskSetResult.restore(setid, backend=task.backend)
+        key = self.get_key_for_chord(gid)
+        deps = GroupResult.restore(gid, backend=task.backend)
         val = self.incr(key)
         if val >= deps.total:
             subtask(task.request.chord).delay(deps.join(propagate=propagate))

+ 2 - 2
celery/backends/cache.py

@@ -100,8 +100,8 @@ class CacheBackend(KeyValueStoreBackend):
     def delete(self, key):
         return self.client.delete(key)
 
-    def on_chord_apply(self, setid, body, result=None, **kwargs):
-        self.client.set(self.get_key_for_chord(setid), '0', time=86400)
+    def on_chord_apply(self, group_id, body, result=None, **kwargs):
+        self.client.set(self.get_key_for_chord(group_id), '0', time=86400)
 
     def incr(self, key):
         return self.client.incr(key)

+ 13 - 13
celery/backends/database/__init__.py

@@ -103,12 +103,12 @@ class DatabaseBackend(BaseDictBackend):
             session.close()
 
     @retry
-    def _save_taskset(self, taskset_id, result):
-        """Store the result of an executed taskset."""
+    def _save_group(self, group_id, result):
+        """Store the result of an executed group."""
         session = self.ResultSession()
         try:
-            taskset = TaskSet(taskset_id, result)
-            session.add(taskset)
+            group = TaskSet(group_id, result)
+            session.add(group)
             session.flush()
             session.commit()
             return result
@@ -116,24 +116,24 @@ class DatabaseBackend(BaseDictBackend):
             session.close()
 
     @retry
-    def _restore_taskset(self, taskset_id):
-        """Get metadata for taskset by id."""
+    def _restore_group(self, group_id):
+        """Get metadata for group by id."""
         session = self.ResultSession()
         try:
-            taskset = session.query(TaskSet).filter(
-                    TaskSet.taskset_id == taskset_id).first()
-            if taskset:
-                return taskset.to_dict()
+            group = session.query(TaskSet).filter(
+                    TaskSet.taskset_id == group_id).first()
+            if group:
+                return group.to_dict()
         finally:
             session.close()
 
     @retry
-    def _delete_taskset(self, taskset_id):
-        """Delete metadata for taskset by id."""
+    def _delete_group(self, group_id):
+        """Delete metadata for group by id."""
         session = self.ResultSession()
         try:
             session.query(TaskSet).filter(
-                    TaskSet.taskset_id == taskset_id).delete()
+                    TaskSet.taskset_id == group_id).delete()
             session.flush()
             session.commit()
         finally:

+ 9 - 9
celery/backends/mongodb.py

@@ -131,18 +131,18 @@ class MongoBackend(BaseDictBackend):
 
         return meta
 
-    def _save_taskset(self, taskset_id, result):
-        """Save the taskset result."""
-        meta = {"_id": taskset_id,
+    def _save_group(self, group_id, result):
+        """Save the group result."""
+        meta = {"_id": group_id,
                 "result": Binary(self.encode(result)),
                 "date_done": datetime.utcnow()}
         self.collection.save(meta, safe=True)
 
         return result
 
-    def _restore_taskset(self, taskset_id):
-        """Get the result for a taskset by id."""
-        obj = self.collection.find_one({"_id": taskset_id})
+    def _restore_group(self, group_id):
+        """Get the result for a group by id."""
+        obj = self.collection.find_one({"_id": group_id})
         if not obj:
             return
 
@@ -154,9 +154,9 @@ class MongoBackend(BaseDictBackend):
 
         return meta
 
-    def _delete_taskset(self, taskset_id):
-        """Delete a taskset by id."""
-        self.collection.remove({"_id": taskset_id})
+    def _delete_group(self, group_id):
+        """Delete a group by id."""
+        self.collection.remove({"_id": group_id})
 
     def _forget(self, task_id):
         """

+ 39 - 30
celery/result.py

@@ -33,7 +33,7 @@ def from_serializable(r):
     if not isinstance(r, ResultBase):
         id, nodes = r
         if nodes:
-            return TaskSetResult(id, [AsyncResult(id) for id, _ in nodes])
+            return GroupResult(id, [AsyncResult(id) for id, _ in nodes])
         return AsyncResult(id)
     return r
 
@@ -127,7 +127,7 @@ class AsyncResult(ResultBase):
 
             @task()
             def A(how_many):
-                return TaskSet(B.s(i) for i in xrange(how_many))
+                return group(B.s(i) for i in xrange(how_many))
 
             @task()
             def B(i):
@@ -545,11 +545,6 @@ class ResultSet(ResultBase):
         return "<%s: %r>" % (self.__class__.__name__,
                              [r.id for r in self.results])
 
-    @property
-    def total(self):
-        """Deprecated: Use ``len(r)``."""
-        return len(self)
-
     @property
     def subtasks(self):
         """Deprecated alias to :attr:`results`."""
@@ -560,50 +555,44 @@ class ResultSet(ResultBase):
         return self.results[0].supports_native_join
 
 
-class TaskSetResult(ResultSet):
-    """An instance of this class is returned by
-    `TaskSet`'s :meth:`~celery.task.TaskSet.apply_async` method.
+class GroupResult(ResultSet):
+    """Like :class:`ResultSet`, but with an associated id.
+
+    This type is returned by :class:`~celery.group`, and the
+    deprecated TaskSet, meth:`~celery.task.TaskSet.apply_async` method.
 
     It enables inspection of the tasks state and return values as
     a single entity.
 
-    :param id: The id of the taskset.
+    :param id: The id of the group.
     :param results: List of result instances.
 
     """
 
-    #: The UUID of the taskset.
+    #: The UUID of the group.
     id = None
 
-    #: List/iterator of results in the taskset
+    #: List/iterator of results in the group
     results = None
 
-    def __init__(self, id, results=None, **kwargs):
+    def __init__(self, id=None, results=None, **kwargs):
         self.id = id
-
-        # XXX previously the "results" arg was named "subtasks".
-        if "subtasks" in kwargs:
-            results = kwargs["subtasks"]
         ResultSet.__init__(self, results, **kwargs)
 
     def save(self, backend=None):
-        """Save taskset result for later retrieval using :meth:`restore`.
+        """Save group-result for later retrieval using :meth:`restore`.
 
         Example::
 
             >>> result.save()
-            >>> result = TaskSetResult.restore(taskset_id)
+            >>> result = GroupResult.restore(group_id)
 
         """
-        return (backend or self.app.backend).save_taskset(self.id, self)
+        return (backend or self.app.backend).save_group(self.id, self)
 
     def delete(self, backend=None):
         """Remove this result if it was previously saved."""
-        (backend or self.app.backend).delete_taskset(self.id)
-
-    def itersubtasks(self):
-        """Depreacted.   Use ``iter(self.results)`` instead."""
-        return iter(self.results)
+        (backend or self.app.backend).delete_group(self.id)
 
     def __reduce__(self):
         return self.__class__, self.__reduce_args__()
@@ -612,7 +601,7 @@ class TaskSetResult(ResultSet):
         return self.id, self.results
 
     def __eq__(self, other):
-        if isinstance(other, TaskSetResult):
+        if isinstance(other, GroupResult):
             return other.id == self.id and other.results == self.results
         return NotImplemented
 
@@ -624,9 +613,29 @@ class TaskSetResult(ResultSet):
         return self.id, [r.serializable() for r in self.results]
 
     @classmethod
-    def restore(self, taskset_id, backend=None):
-        """Restore previously saved taskset result."""
-        return (backend or current_app.backend).restore_taskset(taskset_id)
+    def restore(self, id, backend=None):
+        """Restore previously saved group result."""
+        return (backend or current_app.backend).restore_group(id)
+
+
+class TaskSetResult(GroupResult):
+    """Deprecated version of :class:`GroupResult`"""
+
+    def __init__(self, taskset_id, results=None, **kwargs):
+        # XXX supports the taskset_id kwarg.
+        # XXX previously the "results" arg was named "subtasks".
+        if "subtasks" in kwargs:
+            results = kwargs["subtasks"]
+        GroupResult.__init__(self, taskset_id, results, **kwargs)
+
+    def itersubtasks(self):
+        """Deprecated.   Use ``iter(self.results)`` instead."""
+        return iter(self.results)
+
+    @property
+    def total(self):
+        """Deprecated: Use ``len(r)``."""
+        return len(self)
 
     def _get_taskset_id(self):
         return self.id

+ 2 - 2
celery/tests/app/test_control.py

@@ -189,8 +189,8 @@ class test_Broadcast(Case):
 
     @with_mock_broadcast
     def test_revoke_from_resultset(self):
-        r = self.app.TaskSetResult(uuid(),
-                                   map(self.app.AsyncResult,
+        r = self.app.GroupResult(uuid(),
+                                 map(self.app.AsyncResult,
                                         [uuid() for i in range(10)]))
         r.revoke()
         self.assertIn("revoke", MockMailbox.sent)

+ 8 - 8
celery/tests/backends/test_amqp.py

@@ -286,18 +286,18 @@ class test_AMQPBackend(AppCase):
         with self.assertRaises(NotImplementedError):
             self.create_backend().reload_task_result("x")
 
-    def test_reload_taskset_result(self):
+    def test_reload_group_result(self):
         with self.assertRaises(NotImplementedError):
-            self.create_backend().reload_taskset_result("x")
+            self.create_backend().reload_group_result("x")
 
-    def test_save_taskset(self):
+    def test_save_group(self):
         with self.assertRaises(NotImplementedError):
-            self.create_backend().save_taskset("x", "x")
+            self.create_backend().save_group("x", "x")
 
-    def test_restore_taskset(self):
+    def test_restore_group(self):
         with self.assertRaises(NotImplementedError):
-            self.create_backend().restore_taskset("x")
+            self.create_backend().restore_group("x")
 
-    def test_delete_taskset(self):
+    def test_delete_group(self):
         with self.assertRaises(NotImplementedError):
-            self.create_backend().delete_taskset("x")
+            self.create_backend().delete_group("x")

+ 39 - 39
celery/tests/backends/test_base.py

@@ -8,7 +8,7 @@ from mock import Mock
 from nose import SkipTest
 
 from celery import current_app
-from celery.result import AsyncResult, TaskSetResult
+from celery.result import AsyncResult, GroupResult
 from celery.utils import serialization
 from celery.utils.serialization import subclass_exception
 from celery.utils.serialization import \
@@ -74,25 +74,25 @@ class test_BaseBackend_interface(Case):
         with self.assertRaises(NotImplementedError):
             b.reload_task_result("SOMExx-N0nex1stant-IDxx-")
 
-    def test_reload_taskset_result(self):
+    def test_reload_group_result(self):
         with self.assertRaises(NotImplementedError):
-            b.reload_taskset_result("SOMExx-N0nex1stant-IDxx-")
+            b.reload_group_result("SOMExx-N0nex1stant-IDxx-")
 
     def test_get_result(self):
         with self.assertRaises(NotImplementedError):
             b.get_result("SOMExx-N0nex1stant-IDxx-")
 
-    def test_restore_taskset(self):
+    def test_restore_group(self):
         with self.assertRaises(NotImplementedError):
-            b.restore_taskset("SOMExx-N0nex1stant-IDxx-")
+            b.restore_group("SOMExx-N0nex1stant-IDxx-")
 
-    def test_delete_taskset(self):
+    def test_delete_group(self):
         with self.assertRaises(NotImplementedError):
-            b.delete_taskset("SOMExx-N0nex1stant-IDxx-")
+            b.delete_group("SOMExx-N0nex1stant-IDxx-")
 
-    def test_save_taskset(self):
+    def test_save_group(self):
         with self.assertRaises(NotImplementedError):
-            b.save_taskset("SOMExx-N0nex1stant-IDxx-", "blergh")
+            b.save_group("SOMExx-N0nex1stant-IDxx-", "blergh")
 
     def test_get_traceback(self):
         with self.assertRaises(NotImplementedError):
@@ -189,16 +189,16 @@ class DictBackend(BaseDictBackend):
         BaseDictBackend.__init__(self, *args, **kwargs)
         self._data = {"can-delete": {"result": "foo"}}
 
-    def _restore_taskset(self, taskset_id):
-        if taskset_id == "exists":
-            return {"result": "taskset"}
+    def _restore_group(self, group_id):
+        if group_id == "exists":
+            return {"result": "group"}
 
     def _get_task_meta_for(self, task_id):
         if task_id == "task-exists":
             return {"result": "task"}
 
-    def _delete_taskset(self, taskset_id):
-        self._data.pop(taskset_id, None)
+    def _delete_group(self, group_id):
+        self._data.pop(group_id, None)
 
 
 class test_BaseDictBackend(Case):
@@ -206,8 +206,8 @@ class test_BaseDictBackend(Case):
     def setUp(self):
         self.b = DictBackend()
 
-    def test_delete_taskset(self):
-        self.b.delete_taskset("can-delete")
+    def test_delete_group(self):
+        self.b.delete_group("can-delete")
         self.assertNotIn("can-delete", self.b._data)
 
     def test_prepare_exception_json(self):
@@ -218,29 +218,29 @@ class test_BaseDictBackend(Case):
         self.assertEqual(e.__class__.__name__, "KeyError")
         self.assertEqual(str(e), "'foo'")
 
-    def test_save_taskset(self):
+    def test_save_group(self):
         b = BaseDictBackend()
-        b._save_taskset = Mock()
-        b.save_taskset("foofoo", "xxx")
-        b._save_taskset.assert_called_with("foofoo", "xxx")
+        b._save_group = Mock()
+        b.save_group("foofoo", "xxx")
+        b._save_group.assert_called_with("foofoo", "xxx")
 
     def test_forget_interface(self):
         b = BaseDictBackend()
         with self.assertRaises(NotImplementedError):
             b.forget("foo")
 
-    def test_restore_taskset(self):
-        self.assertIsNone(self.b.restore_taskset("missing"))
-        self.assertIsNone(self.b.restore_taskset("missing"))
-        self.assertEqual(self.b.restore_taskset("exists"), "taskset")
-        self.assertEqual(self.b.restore_taskset("exists"), "taskset")
-        self.assertEqual(self.b.restore_taskset("exists", cache=False),
-                         "taskset")
+    def test_restore_group(self):
+        self.assertIsNone(self.b.restore_group("missing"))
+        self.assertIsNone(self.b.restore_group("missing"))
+        self.assertEqual(self.b.restore_group("exists"), "group")
+        self.assertEqual(self.b.restore_group("exists"), "group")
+        self.assertEqual(self.b.restore_group("exists", cache=False),
+                         "group")
 
-    def test_reload_taskset_result(self):
+    def test_reload_group_result(self):
         self.b._cache = {}
-        self.b.reload_taskset_result("exists")
-        self.b._cache["exists"] = {"result": "taskset"}
+        self.b.reload_group_result("exists")
+        self.b._cache["exists"] = {"result": "group"}
 
     def test_reload_task_result(self):
         self.b._cache = {}
@@ -286,18 +286,18 @@ class test_KeyValueStoreBackend(Case):
         self.assertIsNone(self.b.get_result("xxx-missing"))
         self.assertEqual(self.b.get_status("xxx-missing"), states.PENDING)
 
-    def test_save_restore_delete_taskset(self):
+    def test_save_restore_delete_group(self):
         tid = uuid()
-        tsr = TaskSetResult(tid, [AsyncResult(uuid()) for _ in range(10)])
-        self.b.save_taskset(tid, tsr)
-        stored = self.b.restore_taskset(tid)
+        tsr = GroupResult(tid, [AsyncResult(uuid()) for _ in range(10)])
+        self.b.save_group(tid, tsr)
+        stored = self.b.restore_group(tid)
         print(stored)
-        self.assertEqual(self.b.restore_taskset(tid), tsr)
-        self.b.delete_taskset(tid)
-        self.assertIsNone(self.b.restore_taskset(tid))
+        self.assertEqual(self.b.restore_group(tid), tsr)
+        self.b.delete_group(tid)
+        self.assertIsNone(self.b.restore_group(tid))
 
-    def test_restore_missing_taskset(self):
-        self.assertIsNone(self.b.restore_taskset("xxx-nonexistant"))
+    def test_restore_missing_group(self):
+        self.assertIsNone(self.b.restore_group("xxx-nonexistant"))
 
 
 class test_KeyValueStoreBackend_interface(Case):

+ 4 - 4
celery/tests/backends/test_cache.py

@@ -58,9 +58,9 @@ class test_CacheBackend(Case):
 
     def test_on_chord_apply(self):
         tb = CacheBackend(backend="memory://")
-        tb.on_chord_apply("setid", [])
+        tb.on_chord_apply("group_id", [])
 
-    @patch("celery.result.TaskSetResult")
+    @patch("celery.result.GroupResult")
     def test_on_chord_part_return(self, setresult):
         tb = CacheBackend(backend="memory://")
 
@@ -72,9 +72,9 @@ class test_CacheBackend(Case):
         try:
             current_app.tasks["foobarbaz"] = task
             task.request.chord = subtask(task)
-            task.request.taskset = "setid"
+            task.request.group = "group_id"
 
-            tb.on_chord_apply(task.request.taskset, [])
+            tb.on_chord_apply(task.request.group, [])
 
             self.assertFalse(deps.join.called)
             tb.on_chord_part_return(task)

+ 7 - 7
celery/tests/backends/test_database.py

@@ -165,26 +165,26 @@ class test_DatabaseBackend(Case):
         tb = DatabaseBackend()
         self.assertTrue(loads(dumps(tb)))
 
-    def test_save__restore__delete_taskset(self):
+    def test_save__restore__delete_group(self):
         tb = DatabaseBackend()
 
         tid = uuid()
         res = {u"something": "special"}
-        self.assertEqual(tb.save_taskset(tid, res), res)
+        self.assertEqual(tb.save_group(tid, res), res)
 
-        res2 = tb.restore_taskset(tid)
+        res2 = tb.restore_group(tid)
         self.assertEqual(res2, res)
 
-        tb.delete_taskset(tid)
-        self.assertIsNone(tb.restore_taskset(tid))
+        tb.delete_group(tid)
+        self.assertIsNone(tb.restore_group(tid))
 
-        self.assertIsNone(tb.restore_taskset("xxx-nonexisting-id"))
+        self.assertIsNone(tb.restore_group("xxx-nonexisting-id"))
 
     def test_cleanup(self):
         tb = DatabaseBackend()
         for i in range(10):
             tb.mark_as_done(uuid(), 42)
-            tb.save_taskset(uuid(), {"foo": "bar"})
+            tb.save_group(uuid(), {"foo": "bar"})
         s = tb.ResultSession()
         for t in s.query(Task).all():
             t.date_done = datetime.now() - tb.expires * 2

+ 8 - 8
celery/tests/backends/test_mongodb.py

@@ -69,12 +69,12 @@ class test_MongoBackend(AppCase):
         celery.conf.CELERY_MONGODB_BACKEND_SETTINGS = None
         MongoBackend(app=celery)
 
-    def test_restore_taskset_no_entry(self):
+    def test_restore_group_no_entry(self):
         x = MongoBackend()
         x.collection = Mock()
         fo = x.collection.find_one = Mock()
         fo.return_value = None
-        self.assertIsNone(x._restore_taskset("1f3fab"))
+        self.assertIsNone(x._restore_group("1f3fab"))
 
     def test_reduce(self):
         x = MongoBackend()
@@ -217,7 +217,7 @@ class test_MongoBackend(AppCase):
         self.assertEquals({"status": states.PENDING, "result": None}, ret_val)
 
     @patch("celery.backends.mongodb.MongoBackend._get_database")
-    def test_save_taskset(self, mock_get_database):
+    def test_save_group(self, mock_get_database):
         self.backend.mongodb_taskmeta_collection = MONGODB_COLLECTION
 
         mock_database = MagicMock(spec=['__getitem__', '__setitem__'])
@@ -226,7 +226,7 @@ class test_MongoBackend(AppCase):
         mock_get_database.return_value = mock_database
         mock_database.__getitem__.return_value = mock_collection
 
-        ret_val = self.backend._save_taskset(
+        ret_val = self.backend._save_group(
             sentinel.taskset_id, sentinel.result)
 
         mock_get_database.assert_called_once_with()
@@ -235,7 +235,7 @@ class test_MongoBackend(AppCase):
         self.assertEquals(sentinel.result, ret_val)
 
     @patch("celery.backends.mongodb.MongoBackend._get_database")
-    def test_restore_taskset(self, mock_get_database):
+    def test_restore_group(self, mock_get_database):
         self.backend.mongodb_taskmeta_collection = MONGODB_COLLECTION
 
         mock_database = MagicMock(spec=['__getitem__', '__setitem__'])
@@ -245,7 +245,7 @@ class test_MongoBackend(AppCase):
         mock_get_database.return_value = mock_database
         mock_database.__getitem__.return_value = mock_collection
 
-        ret_val = self.backend._restore_taskset(sentinel.taskset_id)
+        ret_val = self.backend._restore_group(sentinel.taskset_id)
 
         mock_get_database.assert_called_once_with()
         mock_database.__getitem__.assert_called_once_with(MONGODB_COLLECTION)
@@ -254,7 +254,7 @@ class test_MongoBackend(AppCase):
         self.assertEquals(['date_done', 'result', 'task_id'], ret_val.keys())
 
     @patch("celery.backends.mongodb.MongoBackend._get_database")
-    def test_delete_taskset(self, mock_get_database):
+    def test_delete_group(self, mock_get_database):
         self.backend.mongodb_taskmeta_collection = MONGODB_COLLECTION
 
         mock_database = MagicMock(spec=['__getitem__', '__setitem__'])
@@ -263,7 +263,7 @@ class test_MongoBackend(AppCase):
         mock_get_database.return_value = mock_database
         mock_database.__getitem__.return_value = mock_collection
 
-        self.backend._delete_taskset(sentinel.taskset_id)
+        self.backend._delete_group(sentinel.taskset_id)
 
         mock_get_database.assert_called_once_with()
         mock_database.__getitem__.assert_called_once_with(MONGODB_COLLECTION)

+ 3 - 3
celery/tests/backends/test_redis.py

@@ -138,7 +138,7 @@ class test_RedisBackend(Case):
         self.assertEqual(b.expires, 60)
 
     def test_on_chord_apply(self):
-        self.Backend().on_chord_apply("setid", {},
+        self.Backend().on_chord_apply("group_id", {},
                                       result=map(AsyncResult, [1, 2, 3]))
 
     def test_mget(self):
@@ -151,7 +151,7 @@ class test_RedisBackend(Case):
         b.expires = None
         b.set("foo", "bar")
 
-    @patch("celery.result.TaskSetResult")
+    @patch("celery.result.GroupResult")
     def test_on_chord_part_return(self, setresult):
         b = self.MockBackend()
         deps = Mock()
@@ -163,7 +163,7 @@ class test_RedisBackend(Case):
         try:
             current_app.tasks["foobarbaz"] = task
             task.request.chord = subtask(task)
-            task.request.taskset = "setid"
+            task.request.group = "group_id"
 
             b.on_chord_part_return(task)
             self.assertTrue(b.client.incr.call_count)

+ 12 - 12
celery/tests/tasks/test_chord.py

@@ -7,7 +7,7 @@ from contextlib import contextmanager
 from celery import canvas
 from celery import current_app
 from celery import result
-from celery.result import AsyncResult, TaskSetResult
+from celery.result import AsyncResult, GroupResult
 from celery.task import task, TaskSet
 from celery.tests.utils import AppCase, Mock
 
@@ -24,7 +24,7 @@ def callback(r):
     return r
 
 
-class TSR(TaskSetResult):
+class TSR(GroupResult):
     is_ready = True
     value = None
 
@@ -49,8 +49,8 @@ def patch_unlock_retry():
 
 class test_unlock_chord_task(AppCase):
 
-    @patch("celery.result.TaskSetResult")
-    def test_unlock_ready(self, TaskSetResult):
+    @patch("celery.result.GroupResult")
+    def test_unlock_ready(self, GroupResult):
 
         class AlwaysReady(TSR):
             is_ready = True
@@ -60,14 +60,14 @@ class test_unlock_chord_task(AppCase):
         def callback(*args, **kwargs):
             pass
 
-        pts, result.TaskSetResult = result.TaskSetResult, AlwaysReady
+        pts, result.GroupResult = result.GroupResult, AlwaysReady
         callback.apply_async = Mock()
         callback_s = callback.s()
         try:
             with patch_unlock_retry() as (unlock, retry):
                 subtask, canvas.maybe_subtask = canvas.maybe_subtask, passthru
                 try:
-                    unlock("setid", callback_s,
+                    unlock("group_id", callback_s,
                            result=map(AsyncResult, [1, 2, 3]))
                 finally:
                     canvas.maybe_subtask = subtask
@@ -75,25 +75,25 @@ class test_unlock_chord_task(AppCase):
                 # did not retry
                 self.assertFalse(retry.call_count)
         finally:
-            result.TaskSetResult = pts
+            result.GroupResult = pts
 
-    @patch("celery.result.TaskSetResult")
-    def test_when_not_ready(self, TaskSetResult):
+    @patch("celery.result.GroupResult")
+    def test_when_not_ready(self, GroupResult):
         with patch_unlock_retry() as (unlock, retry):
 
             class NeverReady(TSR):
                 is_ready = False
 
-            pts, result.TaskSetResult = result.TaskSetResult, NeverReady
+            pts, result.GroupResult = result.GroupResult, NeverReady
             try:
                 callback = Mock()
-                unlock("setid", callback, interval=10, max_retries=30,
+                unlock("group_id", callback, interval=10, max_retries=30,
                             result=map(AsyncResult, [1, 2, 3]))
                 self.assertFalse(callback.delay.call_count)
                 # did retry
                 unlock.retry.assert_called_with(countdown=10, max_retries=30)
             finally:
-                result.TaskSetResult = pts
+                result.GroupResult = pts
 
     def test_is_in_registry(self):
         self.assertIn("celery.chord_unlock", current_app.tasks)

+ 25 - 26
celery/tests/tasks/test_result.py

@@ -12,7 +12,7 @@ from celery.utils.serialization import pickle
 from celery.result import (
     AsyncResult,
     EagerResult,
-    TaskSetResult,
+    GroupResult,
     ResultSet,
     from_serializable,
 )
@@ -46,7 +46,7 @@ def save_result(task):
                 traceback=traceback)
 
 
-def make_mock_taskset(size=10):
+def make_mock_group(size=10):
     tasks = [mock_task("ts%d" % i, states.SUCCESS, i) for i in xrange(size)]
     [save_result(task) for task in tasks]
     return [AsyncResult(task["id"]) for task in tasks]
@@ -334,11 +334,11 @@ class SimpleBackend(object):
             return ((id, {"result": i}) for i, id in enumerate(self.ids))
 
 
-class test_TaskSetResult(AppCase):
+class test_GroupResult(AppCase):
 
     def setup(self):
         self.size = 10
-        self.ts = TaskSetResult(uuid(), make_mock_taskset(self.size))
+        self.ts = GroupResult(uuid(), make_mock_group(self.size))
 
     def test_total(self):
         self.assertEqual(len(self.ts), self.size)
@@ -356,12 +356,12 @@ class test_TaskSetResult(AppCase):
         self.assertTrue(loads(dumps(self.ts)))
 
     def test_compat_subtasks_kwarg(self):
-        x = TaskSetResult(uuid(), subtasks=[1, 2, 3])
+        x = GroupResult(uuid(), subtasks=[1, 2, 3])
         self.assertEqual(x.results, [1, 2, 3])
 
     def test_iterate_raises(self):
         ar = MockAsyncResultFailure(uuid())
-        ts = TaskSetResult(uuid(), [ar])
+        ts = GroupResult(uuid(), [ar])
         it = iter(ts)
         with self.assertRaises(KeyError):
             it.next()
@@ -369,7 +369,7 @@ class test_TaskSetResult(AppCase):
     def test_forget(self):
         subs = [MockAsyncResultSuccess(uuid()),
                 MockAsyncResultSuccess(uuid())]
-        ts = TaskSetResult(uuid(), subs)
+        ts = GroupResult(uuid(), subs)
         ts.forget()
         for sub in subs:
             self.assertTrue(sub.forgotten)
@@ -377,28 +377,28 @@ class test_TaskSetResult(AppCase):
     def test_getitem(self):
         subs = [MockAsyncResultSuccess(uuid()),
                 MockAsyncResultSuccess(uuid())]
-        ts = TaskSetResult(uuid(), subs)
+        ts = GroupResult(uuid(), subs)
         self.assertIs(ts[0], subs[0])
 
     def test_save_restore(self):
         subs = [MockAsyncResultSuccess(uuid()),
                 MockAsyncResultSuccess(uuid())]
-        ts = TaskSetResult(uuid(), subs)
+        ts = GroupResult(uuid(), subs)
         ts.save()
         with self.assertRaises(AttributeError):
             ts.save(backend=object())
-        self.assertEqual(TaskSetResult.restore(ts.taskset_id).subtasks,
+        self.assertEqual(GroupResult.restore(ts.id).subtasks,
                          ts.subtasks)
         ts.delete()
-        self.assertIsNone(TaskSetResult.restore(ts.taskset_id))
+        self.assertIsNone(GroupResult.restore(ts.id))
         with self.assertRaises(AttributeError):
-            TaskSetResult.restore(ts.taskset_id, backend=object())
+            GroupResult.restore(ts.id, backend=object())
 
     def test_join_native(self):
         backend = SimpleBackend()
         subtasks = [AsyncResult(uuid(), backend=backend)
                         for i in range(10)]
-        ts = TaskSetResult(uuid(), subtasks)
+        ts = GroupResult(uuid(), subtasks)
         backend.ids = [subtask.id for subtask in subtasks]
         res = ts.join_native()
         self.assertEqual(res, range(10))
@@ -407,14 +407,14 @@ class test_TaskSetResult(AppCase):
         backend = SimpleBackend()
         subtasks = [AsyncResult(uuid(), backend=backend)
                         for i in range(10)]
-        ts = TaskSetResult(uuid(), subtasks)
+        ts = GroupResult(uuid(), subtasks)
         backend.ids = [subtask.id for subtask in subtasks]
         self.assertEqual(len(list(ts.iter_native())), 10)
 
     def test_iterate_yields(self):
         ar = MockAsyncResultSuccess(uuid())
         ar2 = MockAsyncResultSuccess(uuid())
-        ts = TaskSetResult(uuid(), [ar, ar2])
+        ts = GroupResult(uuid(), [ar, ar2])
         it = iter(ts)
         self.assertEqual(it.next(), 42)
         self.assertEqual(it.next(), 42)
@@ -422,7 +422,7 @@ class test_TaskSetResult(AppCase):
     def test_iterate_eager(self):
         ar1 = EagerResult(uuid(), 42, states.SUCCESS)
         ar2 = EagerResult(uuid(), 42, states.SUCCESS)
-        ts = TaskSetResult(uuid(), [ar1, ar2])
+        ts = GroupResult(uuid(), [ar1, ar2])
         it = iter(ts)
         self.assertEqual(it.next(), 42)
         self.assertEqual(it.next(), 42)
@@ -431,7 +431,7 @@ class test_TaskSetResult(AppCase):
         ar = MockAsyncResultSuccess(uuid())
         ar2 = MockAsyncResultSuccess(uuid())
         ar3 = AsyncResult(uuid())
-        ts = TaskSetResult(uuid(), [ar, ar2, ar3])
+        ts = GroupResult(uuid(), [ar, ar2, ar3])
         with self.assertRaises(TimeoutError):
             ts.join(timeout=0.0000001)
 
@@ -478,15 +478,15 @@ class test_pending_AsyncResult(AppCase):
         self.assertIsNone(self.task.result)
 
 
-class test_failed_AsyncResult(test_TaskSetResult):
+class test_failed_AsyncResult(test_GroupResult):
 
     def setup(self):
         self.size = 11
-        subtasks = make_mock_taskset(10)
+        subtasks = make_mock_group(10)
         failed = mock_task("ts11", states.FAILURE, KeyError("Baz"))
         save_result(failed)
         failed_res = AsyncResult(failed["id"])
-        self.ts = TaskSetResult(uuid(), subtasks + [failed_res])
+        self.ts = GroupResult(uuid(), subtasks + [failed_res])
 
     def test_itersubtasks(self):
 
@@ -522,12 +522,11 @@ class test_failed_AsyncResult(test_TaskSetResult):
         self.assertTrue(self.ts.failed())
 
 
-class test_pending_TaskSet(AppCase):
+class test_pending_Group(AppCase):
 
     def setup(self):
-        self.ts = TaskSetResult(uuid(), [
-                                        AsyncResult(uuid()),
-                                        AsyncResult(uuid())])
+        self.ts = GroupResult(uuid(), [AsyncResult(uuid()),
+                                       AsyncResult(uuid())])
 
     def test_completed_count(self):
         self.assertEqual(self.ts.completed_count(), 0)
@@ -584,7 +583,7 @@ class test_serializable(AppCase):
         self.assertEqual(x, from_serializable(x.serializable()))
         self.assertEqual(x, from_serializable(x))
 
-    def test_TaskSetResult(self):
-        x = TaskSetResult(uuid(), [AsyncResult(uuid()) for _ in range(10)])
+    def test_GroupResult(self):
+        x = GroupResult(uuid(), [AsyncResult(uuid()) for _ in range(10)])
         self.assertEqual(x, from_serializable(x.serializable()))
         self.assertEqual(x, from_serializable(x))

+ 2 - 1
celery/worker/job.py

@@ -183,7 +183,8 @@ class Request(object):
             kwargs = self.extend_with_default_kwargs()
         request = self.request_dict
         request.update({"hostname": hostname, "is_eager": False,
-                        "delivery_info": self.delivery_info})
+                        "delivery_info": self.delivery_info,
+                        "group": self.request_dict.get("taskset")})
         result = pool.apply_async(trace_task_ret,
                                   args=(self.name, self.id,
                                         self.args, kwargs, request),

+ 1 - 0
contrib/release/doc4allmods

@@ -4,6 +4,7 @@ PACKAGE="$1"
 SKIP_PACKAGES="$PACKAGE tests management urls"
 SKIP_FILES="celery.__compat__.rst
             celery.backends.pyredis.rst
+            celery.task.sets.rst
             celery.bin.rst
             celery.bin.celeryd_detach.rst
             celery.bin.celeryctl.rst

+ 6 - 5
docs/internals/deprecation.rst

@@ -111,18 +111,19 @@ is deprecated and must be set by :setting:`CELERY_ROUTES` instead.
 
 - ``BaseAsyncResult`` -> ``AsyncResult``.
 
-- ``TaskSetResult.total`` -> ``len(TaskSetResult)``
+- ``TaskSetResult`` -> ``GroupResult``.
+
+- ``TaskSetResult.total`` -> ``len(GroupResult)``
+
+- ``TaskSetResult.taskset_id`` -> ``GroupResult.id``
 
 Apply to: :class:`~celery.result.AsyncResult`,
-:class:`~celery.result.ResultSet`, :class:`~celery.result.EagerResult`,
-:class:`~celery.result.TaskSetResult`.
+:class:`~celery.result.EagerResult`::
 
 - ``Result.wait()`` -> ``Result.get()``
 
 - ``Result.task_id()`` -> ``Result.id``
 
-- ``TaskSetResult.taskset_id`` -> ``TaskSetResult.id``
-
 - ``Result.status`` -> ``Result.state``.
 
 :mod:`celery.loader`

+ 3 - 3
docs/reference/celery.rst

@@ -171,10 +171,10 @@ Application
 
         Create new result instance. See :class:`~celery.result.AsyncResult`.
 
-    .. attribute:: TaskSetResult
+    .. attribute:: GroupResult
 
         Create new taskset result instance.
-        See :class:`~celery.result.TaskSetResult`.
+        See :class:`~celery.result.GroupResult`.
 
     .. method:: worker_main(argv=None)
 
@@ -264,7 +264,7 @@ Grouping Tasks
         >>> res.get()
         [4, 8]
 
-    The ``apply_async`` method returns :class:`~@TaskSetResult`.
+    The ``apply_async`` method returns :class:`~@GroupResult`.
 
 .. class:: chain(*tasks)
 

+ 10 - 10
docs/userguide/canvas.rst

@@ -117,47 +117,47 @@ Group Results
 -------------
 
 When a  :class:`~celery.group` is applied it returns a
-:class:`~celery.result.TaskSetResult` object.
+:class:`~celery.result.GroupResult` object.
 
-:class:`~celery.result.TaskSetResult` takes a list of
+:class:`~celery.result.GroupResult` takes a list of
 :class:`~celery.result.AsyncResult` instances and operates on them as if it was a
 single task.
 
 It supports the following operations:
 
-* :meth:`~celery.result.TaskSetResult.successful`
+* :meth:`~celery.result.GroupResult.successful`
 
     Returns :const:`True` if all of the subtasks finished
     successfully (e.g. did not raise an exception).
 
-* :meth:`~celery.result.TaskSetResult.failed`
+* :meth:`~celery.result.GroupResult.failed`
 
     Returns :const:`True` if any of the subtasks failed.
 
-* :meth:`~celery.result.TaskSetResult.waiting`
+* :meth:`~celery.result.GroupResult.waiting`
 
     Returns :const:`True` if any of the subtasks
     is not ready yet.
 
-* :meth:`~celery.result.TaskSetResult.ready`
+* :meth:`~celery.result.GroupResult.ready`
 
     Return :const:`True` if all of the subtasks
     are ready.
 
-* :meth:`~celery.result.TaskSetResult.completed_count`
+* :meth:`~celery.result.GroupResult.completed_count`
 
     Returns the number of completed subtasks.
 
-* :meth:`~celery.result.TaskSetResult.revoke`
+* :meth:`~celery.result.GroupResult.revoke`
 
     Revokes all of the subtasks.
 
-* :meth:`~celery.result.TaskSetResult.iterate`
+* :meth:`~celery.result.GroupResult.iterate`
 
     Iterates over the return values of the subtasks
     as they finish, one by one.
 
-* :meth:`~celery.result.TaskSetResult.join`
+* :meth:`~celery.result.GroupResult.join`
 
     Gather the results for all of the subtasks
     and return a list with them ordered by the order of which they