Permalink
Browse files

Adds worker bootstep graphs to docs

  • Loading branch information...
ask committed Oct 4, 2012
1 parent f2e7962 commit 36532b6a2000f0b1ba4a2eff0120e47421adee70
Showing with 37 additions and 3 deletions.
  1. +1 −0 celery/worker/consumer.py
  2. +7 −0 docs/glossary.rst
  3. +2 −2 docs/history/changelog-2.0.rst
  4. +1 −0 docs/reference/index.rst
  5. +20 −1 docs/userguide/extending.rst
  6. +6 −0 pavement.py
@@ -458,6 +458,7 @@ def shutdown(self, c):
class Agent(bootsteps.StartStopStep):
+ conditional = True
requires = (Connection, )
def __init__(self, c, **kwargs):
View
@@ -15,6 +15,13 @@ Glossary
Sends a task message so that the task function is
:term:`executed <executing>` by a worker.
+ kombu
+ Python messaging library used by Celery to send and receive messages.
+
+ billiard
+ Fork of the Python multiprocessing library containing improvements
+ required by Celery.
+
executing
Workers *execute* task :term:`requests <request>`.
@@ -569,10 +569,10 @@ Backward incompatible changes
===================================== =====================================
* The `celery.task.rest` module has been removed, use :mod:`celery.task.http`
- instead (as scheduled by the `deprecation timeline`_).
+ instead (as scheduled by the :ref:`deprecation-timeline`).
* It's no longer allowed to skip the class name in loader names.
- (as scheduled by the `deprecation timeline`_):
+ (as scheduled by the :ref:`deprecation-timeline`):
Assuming the implicit `Loader` class name is no longer supported,
if you use e.g.::
View
@@ -20,6 +20,7 @@
celery.app.builtins
celery.app.log
celery.app.utils
+ celery.bootsteps
celery.task
celery.task.base
celery.result
@@ -13,6 +13,22 @@
Bootsteps
=========
+.. _extending-worker-bootsteps:
+
+Worker Bootsteps
+================
+
+.. figure:: ../images/worker_graph.png
+ :width: 700px
+
+
+Consumer Bootsteps
+==================
+
+.. figure:: ../images/consumer_graph.png
+ :width: 700px
+
+
.. _extending-programs:
Command-line programs
@@ -67,7 +83,7 @@ of :class:`celery.bin.base.Command`. Sadly there is limited documentation,
but you can find inspiration from the various commands in the
:mod:`celery.bin` package.
-This is how the `Flower`_ extension adds the :program:`celery flower` command,
+This is how the Flower_ monitoring extension adds the :program:`celery flower` command,
by adding an entry-point in :file:`setup.py`:
.. code-block:: python
@@ -82,6 +98,8 @@ by adding an entry-point in :file:`setup.py`:
)
+.. _Flower: http://pypi.python.org/pypi/flower
+
The command definition is in two parts separated by the equal sign, where the
first part is the name of the subcommand (flower), then the fully qualified
module path to the class that implements the command
@@ -91,6 +109,7 @@ module path to the class that implements the command
In the module :file:`flower/command.py`, the command class is defined
something like this:
+.. code-block:: python
from celery.bin.base import Command, Option
View
@@ -136,6 +136,12 @@ def removepyc(options):
' -o '.join("-name '{0}'".format(pat) for pat in PYCOMPILE_CACHES)))
+@task
+def update_graphs(options):
+ sh('celery worker_graph | dot -Tpng -o docs/images/worker_graph.png')
+ sh('celery consumer_graph | dot -Tpng -o docs/images/consumer_graph.png')
+
+
@task
@needs('removepyc')
def gitclean(options):

0 comments on commit 36532b6

Please sign in to comment.