Jelajahi Sumber

Some various documentation improvements

Ask Solem 14 tahun lalu
induk
melakukan
cc6afee952
3 mengubah file dengan 41 tambahan dan 22 penghapusan
  1. 21 13
      docs/userguide/executing.rst
  2. 2 0
      docs/userguide/index.rst
  3. 18 9
      docs/userguide/monitoring.rst

+ 21 - 13
docs/userguide/executing.rst

@@ -29,13 +29,6 @@ The same thing using ``apply_async`` is written like this:
 
     Task.apply_async(args=[arg1, arg2], kwargs={"kwarg1": "x", "kwarg2": "y"})
 
-You can also execute a task by name using :func:`~celery.execute.send_task`, 
-if you don't have access to the task's class::
-
-    >>> from celery.execute import send_task
-    >>> result = send_task("tasks.add", [2, 2])
-    >>> result.get()
-    4
 
 While ``delay`` is convenient, it doesn't give you as much control as using ``apply_async``.
 With ``apply_async`` you can override the execution options available as attributes on
@@ -53,6 +46,17 @@ task, which adds together two numbers:
         return x + y
 
 
+.. note::
+
+    You can also execute a task by name using
+    :func:`~celery.execute.send_task`, if you don't have access to the
+    task class::
+
+        >>> from celery.execute import send_task
+        >>> result = send_task("tasks.add", [2, 2])
+        >>> result.get()
+        4
+
 .. _executing-eta:
 
 ETA and countdown
@@ -223,15 +227,18 @@ Later, if the crop task is consuming a lot of resources,
 we can bind some new workers to handle just the ``"image.crop"`` task,
 by creating a new queue that binds to ``"image.crop``".
 
-To find out more about routing, please see :ref:`guide-routing`.
+.. seealso::
+
+    To find out more about routing, please see :ref:`guide-routing`.
 
 .. _executing-amq-opts:
 
 AMQP options
 ============
 
-**NOTE** The ``mandatory`` and ``immediate`` flags are not supported by
-``amqplib`` at this point.
+.. warning::
+    The ``mandatory`` and ``immediate`` flags are not supported by
+    :mod:`amqplib` at this point.
 
 * mandatory
 
@@ -246,6 +253,7 @@ if the task cannot be routed to a worker immediately.
 * priority
 
 A number between ``0`` and ``9``, where ``0`` is the highest priority.
-Note that RabbitMQ does not implement AMQP priorities, and maybe your broker
-does not either, consult your broker's documentation for more
-information.
+
+.. note::
+
+    RabbitMQ does not yet support AMQP priorities.

+ 2 - 0
docs/userguide/index.rst

@@ -1,3 +1,5 @@
+.. _guide:
+
 ============
  User Guide
 ============

+ 18 - 9
docs/userguide/monitoring.rst

@@ -24,6 +24,8 @@ Workers
 celeryctl: Management Utility
 -----------------------------
 
+.. versionadded:: 2.1
+
 :mod:`~celery.bin.celeryctl` is a command line utility to inspect
 and manage worker nodes (and to some degree tasks).
 
@@ -109,11 +111,12 @@ Commands
         $ celeryctl inspect disable_events
 
 
-:Note: All ``inspect`` commands supports the ``--timeout`` argument,
-       which is the number of seconds to wait for responses.
-       You may have to increase this timeout If you're getting empty responses
-       due to latency.
+.. note::
 
+    All ``inspect`` commands supports a ``--timeout`` argument,
+    This is the number of seconds to wait for responses.
+    You may have to increase this timeout if you're getting empty responses
+    due to latency.
 
 .. _celeryctl-inspect-destination:
 
@@ -132,6 +135,8 @@ You can specify a single, or a list of workers by using the
 Django Admin Monitor
 --------------------
 
+.. versionadded:: 2.1
+
 When you add `django-celery`_ to your Django project you will
 automatically get a monitor section as part of the Django admin interface.
 
@@ -159,7 +164,6 @@ To start the camera run::
 
     $ python manage.py celerycam
 
-
 If you haven't already enabled the sending of events you need to do so::
 
     $ python manage.py celeryctl inspect enable_events
@@ -210,6 +214,8 @@ TODO
 celeryev: Curses Monitor
 ------------------------
 
+.. versionadded:: 2.0
+
 :mod:`~celery.bin.celeryev` is a simple curses monitor displaying
 task and worker history. You can inspect the result and traceback of tasks,
 and it also supports some management commands like rate limiting and shutdown
@@ -261,11 +267,12 @@ with this you can list queues, exchanges, bindings,
 queue lenghts, the memory usage of each queue, as well
 as manage users, virtual hosts and their permissions.
 
-:Note: The default virtual host (``"/"``) is used in these
-       examples, if you use a custom virtual host you have to add
-       the ``-p`` argument to the command, e.g:
-       ``rabbitmqctl list_queues -p my_vhost ....``
+.. note::
 
+    The default virtual host (``"/"``) is used in these
+    examples, if you use a custom virtual host you have to add
+    the ``-p`` argument to the command, e.g:
+    ``rabbitmqctl list_queues -p my_vhost ....``
 
 .. _`rabbitmqctl(1)`: http://www.rabbitmq.com/man/rabbitmqctl.1.man.html
 
@@ -337,6 +344,8 @@ happens. These events are then captured by tools like ``celerymon`` and
 Snapshots
 ---------
 
+.. versionadded: 2.1
+
 Even a single worker can produce a huge amount of events, so storing
 history of events on disk may be very expensive.