Ver Fonte

Cosmetic changes to the User Guide

Ask Solem há 14 anos atrás
pai
commit
25e7a2c114
2 ficheiros alterados com 13 adições e 11 exclusões
  1. 7 7
      docs/userguide/routing.rst
  2. 6 4
      docs/userguide/tasksets.rst

+ 7 - 7
docs/userguide/routing.rst

@@ -284,7 +284,7 @@ One for video, one for images and finally, one default queue for everything else
 Here, the ``CELERY_DEFAULT_QUEUE`` will be used to route tasks that doesn't
 have an explicit route.
 
-THe default exchange, exchange type and routing key, will be used as the
+The default exchange, exchange type and routing key will be used as the
 default routing values for tasks, and as the default values for entries
 in ``CELERY_QUEUES``.
 
@@ -293,12 +293,12 @@ Specifying task destination
 
 The destination for a task is decided by the following (in order):
 
-# The :ref:`routers` defined in ``CELERY_ROUTES``.
-# The routing arguments to :func:`~celery.execute.apply_async`.
-# Routing related attributes defined on the :class:`~celery.task.base.Task` itself.
+1. The :ref:`routers` defined in ``CELERY_ROUTES``.
+2. The routing arguments to :func:`~celery.execute.apply_async`.
+3. Routing related attributes defined on the :class:`~celery.task.base.Task` itself.
 
 It is considered best practice to not hard-code these settings, but rather
-leave that as an configuration option by using :ref:`routers`.
+leave that as configuration options by using :ref:`routers`;
 This is the most flexible approach, but sensible defaults can still be set
 as task attributes.
 
@@ -309,7 +309,7 @@ Routers
 
 A router is a class that decides the routing options for a task.
 
-All you need to define a new router, is to create a class with a
+All you need to define a new router is to create a class with a
 ``route_for_task`` method:
 
 .. code-block:: python
@@ -344,7 +344,7 @@ Router classes can also be added by name::
     CELERY_ROUTES = ("myapp.routers.MyRouter", )
 
 
-For simple task name -> route mappings, like the router example above, you can simply
+For simple task name -> route mappings like the router example above, you can simply
 drop a dict into ``CELERY_ROUTES`` to get the same result::
 
     CELERY_ROUTES = ({"myapp.tasks.compress_video": {

+ 6 - 4
docs/userguide/tasksets.rst

@@ -29,6 +29,9 @@ Also it can be regarded as a type, as the following usage works::
 
 This makes it excellent as a means to pass callbacks around to tasks.
 
+Callbacks
+---------
+
 Let's improve our ``add`` task so it can accept a callback that
 takes the result as an argument::
 
@@ -64,7 +67,6 @@ and ``subtask.apply_async(result, ignore_result=False)`` becomes::
 
     >>> add.apply_async(args=(result, 10), ignore_result=False)
 
-
 Now let's execute our new ``add`` task with a callback::
 
     >>> add.delay(2, 2, callback=add.subtask((8, )))
@@ -72,7 +74,7 @@ Now let's execute our new ``add`` task with a callback::
 As expected this will first launch one task calculating ``2 + 2``, then 
 another task calculating ``4 + 8``.
 
-TaskSets
+Task Sets
 =========
 
 The :class:`~celery.task.sets.TaskSet` enables easy invocation of several
@@ -101,8 +103,8 @@ The task set works on a list of :class:`~celery.task.sets.subtask`'s::
     [4, 8, 16, 32, 64]
 
 
-TaskSet Results
-===============
+Results
+-------
 
 When a  :class:`~celery.task.sets.TaskSet` is applied it returns a
 :class:`~celery.result.TaskSetResult` object.