|
@@ -27,6 +27,19 @@ Example generic app. This is decoupled from the rest of the project by using
|
|
the ``@shared_task`` decorator. This decorator returns a proxy that always
|
|
the ``@shared_task`` decorator. This decorator returns a proxy that always
|
|
points to the currently active Celery instance.
|
|
points to the currently active Celery instance.
|
|
|
|
|
|
|
|
+Installing requirements
|
|
|
|
+=======================
|
|
|
|
+
|
|
|
|
+The settings file assumes that ``rabbitmq-server`` is running on ``localhost``
|
|
|
|
+using the default ports. More information here:
|
|
|
|
+
|
|
|
|
+http://docs.celeryproject.org/en/latest/getting-started/brokers/rabbitmq.html
|
|
|
|
+
|
|
|
|
+In addition, some Python requirements must also be satisfied:
|
|
|
|
+
|
|
|
|
+.. code-block:: bash
|
|
|
|
+
|
|
|
|
+ $ pip install -r requirements.txt
|
|
|
|
|
|
Starting the worker
|
|
Starting the worker
|
|
===================
|
|
===================
|
|
@@ -34,3 +47,14 @@ Starting the worker
|
|
.. code-block:: bash
|
|
.. code-block:: bash
|
|
|
|
|
|
$ celery -A proj worker -l info
|
|
$ celery -A proj worker -l info
|
|
|
|
+
|
|
|
|
+Running a task
|
|
|
|
+===================
|
|
|
|
+
|
|
|
|
+.. code-block:: bash
|
|
|
|
+
|
|
|
|
+ $ python ./manage.sh shell
|
|
|
|
+ >>> from demoapp.tasks import add, mul, xsum
|
|
|
|
+ >>> res = add.delay(2,3)
|
|
|
|
+ >>> res.get()
|
|
|
|
+ 5
|