浏览代码

Updates docs after group.apply_async change

Ask Solem 11 年之前
父节点
当前提交
a51121c998
共有 2 个文件被更改,包括 8 次插入29 次删除
  1. 0 29
      docs/userguide/canvas.rst
  2. 8 0
      docs/whatsnew-3.1.rst

+ 0 - 29
docs/userguide/canvas.rst

@@ -317,27 +317,6 @@ Here's some examples:
         >>> res.get(timeout=1)
         [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
 
-    - For primitives `.apply_async` is special...
-
-        as it will create a temporary task to apply the tasks in,
-        for example by *applying the group*::
-
-            >>> g = group(add.s(i, i) for i in xrange(10))
-            >>> g()  # << applying
-
-        the act of sending the messages for the tasks in the group
-        will happen in the current process,
-        but with ``.apply_async`` this happens in a temporary task
-        instead::
-
-            >>> g = group(add.s(i, i) for i in xrange(10))
-            >>> g.apply_async()
-
-        This is useful because you can e.g. specify a time for the
-        messages in the group to be called::
-
-            >>> g.apply_async(countdown=10)
-
 - Simple chord
 
     The chord primitive enables us to add callback to be called when
@@ -593,14 +572,6 @@ or tell how many tasks are ready and so on::
     >>> res.get()
     [4, 8]
 
-However, if you call ``apply_async`` on the group it will
-send a special grouping task, so that the action of calling
-the tasks happens in a worker instead of the current process::
-
-    >>> res = g.apply_async()
-    >>> res.get()
-    [4, 8]
-
 Group also supports iterators::
 
     >>> group(add.s(i, i) for i in xrange(100))()

+ 8 - 0
docs/whatsnew-3.1.rst

@@ -160,6 +160,14 @@ In Other News
     no longer happens as a side-effect of importing the :mod:`djcelery`
     module.
 
+- Canvas: ``group.apply_async`` and ``chain.apply_async`` no longer starts
+  separate task.
+
+    That the group and chord primitives supported the "calling API" like other
+    subtasks was a nice idea, but it was useless in practice, often confusing
+    users.  If you still want this behavior you can create a task to do it
+    for you.
+
 - Redis: Option to separate broadcast messages by virtual host (Issue #1490).
 
     Broadcast messages are seen by all virtual hosts when using the Redis