瀏覽代碼

Merge branch 'master' into paltman/scheduled-periodic-task

Ask Solem 15 年之前
父節點
當前提交
d172583481

+ 8 - 0
FAQ

@@ -274,6 +274,14 @@ Windows: The ``-B`` / ``--beat`` option to celeryd doesn't work?
 **Answer**: That's right. Run ``celerybeat`` and ``celeryd`` as separate
 services instead.
 
+Tasks
+=====
+
+How can I reuse the same connection when applying tasks?
+--------------------------------------------------------
+
+**Answer**: See :doc:`userguide/executing`.
+
 Results
 =======
 

+ 2 - 0
celery/conf.py

@@ -61,6 +61,7 @@ _DEFAULTS = {
     "CELERY_EVENT_EXCHANGE": "celeryevent",
     "CELERY_EVENT_EXCHANGE_TYPE": "direct",
     "CELERY_EVENT_ROUTING_KEY": "celeryevent",
+    "CELERY_EVENT_SERIALIZER": "pickle",
     "CELERY_RESULT_EXCHANGE": "celeryresults",
     "CELERY_MAX_CACHED_RESULTS": 5000,
     "CELERY_TRACK_STARTED": False,
@@ -200,6 +201,7 @@ EVENT_QUEUE = _get("CELERY_EVENT_QUEUE")
 EVENT_EXCHANGE = _get("CELERY_EVENT_EXCHANGE")
 EVENT_EXCHANGE_TYPE = _get("CELERY_EVENT_EXCHANGE_TYPE")
 EVENT_ROUTING_KEY = _get("CELERY_EVENT_ROUTING_KEY")
+EVENT_SERIALIZER = _get("CELERY_EVENT_SERIALIZER")
 
 # :--- Broker connections                           <-   --   --- - ----- -- #
 BROKER_CONNECTION_TIMEOUT = _get("CELERY_BROKER_CONNECTION_TIMEOUT",

+ 1 - 0
celery/messaging.py

@@ -125,6 +125,7 @@ class EventPublisher(Publisher):
     exchange = conf.EVENT_EXCHANGE
     exchange_type = conf.EVENT_EXCHANGE_TYPE
     routing_key = conf.EVENT_ROUTING_KEY
+    serializer = conf.EVENT_SERIALIZER
 
 
 class EventConsumer(Consumer):

+ 4 - 0
contrib/supervisord/celeryd.conf

@@ -20,6 +20,10 @@ autostart=true
 autorestart=true
 startsecs=10
 
+; Need to wait for currently executing tasks to finish at shutdown.
+; Increase this if you have very long running tasks.
+stopwaitsecs = 600
+
 ; if rabbitmq is supervised, set its priority higher
 ; so it starts first
 priority=998

+ 4 - 0
contrib/supervisord/django/celeryd.conf

@@ -13,6 +13,10 @@ autostart=true
 autorestart=true
 startsecs=10
 
+; Need to wait for currently executing tasks to finish at shutdown.
+; Increase this if you have very long running tasks.
+stopwaitsecs = 600
+
 ; if rabbitmq is supervised, set its priority higher
 ; so it starts first
 priority=998

+ 5 - 0
docs/internals/moduleindex.rst

@@ -8,6 +8,11 @@ Worker
 celery.worker
 -------------
 
+* :class:`celery.worker.WorkController`
+
+This is the worker's main process. It starts and stops all the components
+required by the worker: Pool, Mediator, Scheduler, ClockService, and Listener.
+
 celery.worker.job
 -----------------
 

+ 10 - 1
docs/tutorials/external.rst

@@ -41,7 +41,8 @@ http://robertpogorzelski.com/blog/2009/09/10/rabbitmq-celery-and-django/
 Message Queues, Django and Celery Quick Start
 =============================================
 
-Celery tutorial by `Rich Leland`_, the installation section is Mac OS X specific:
+Celery tutorial by `Rich Leland`_, the installation section is Mac OS X
+specific:
 http://mathematism.com/2010/feb/16/message-queues-django-and-celery-quick-start/
 
 .. _`Rich Leland`: http://twitter.com/richleland
@@ -55,6 +56,14 @@ Background task processing and deferred execution in Django
 
 .. _`Alon Swartz`: http://twitter.com/alonswartz
 
+Build a processing queue [...] in less than a day using RabbitMQ and Celery
+===========================================================================
+
+Tutorial in 2 parts written by `Tim Bull`_:
+http://timbull.com/build-a-processing-queue-with-multi-threading
+
+.. _`Tim Bull`: http://twitter.com/timbull
+
 How to get celeryd to work on FreeBSD
 =====================================