Explorar el Código

Adds app.producer_pool alias to app.amqp.producer_pool

Ask Solem hace 9 años
padre
commit
ff57c80f37
Se han modificado 2 ficheros con 6 adiciones y 1 borrados
  1. 5 1
      celery/app/base.py
  2. 1 0
      docs/reference/celery.rst

+ 5 - 1
celery/app/base.py

@@ -771,7 +771,7 @@ class Celery(object):
 
         """
         return FallbackContext(
-            producer, self.amqp.producer_pool.acquire, block=True,
+            producer, self.producer_pool.acquire, block=True,
         )
     default_producer = producer_or_acquire  # XXX compat
 
@@ -1124,6 +1124,10 @@ class Celery(object):
         self.finalize(auto=True)
         return self._tasks
 
+    @property
+    def producer_pool(self):
+        return self.amqp.producer_pool
+
     @cached_property
     def timezone(self):
         """Current timezone for this app.

+ 1 - 0
docs/reference/celery.rst

@@ -49,6 +49,7 @@ and creating Celery applications.
     .. autoattribute:: log
     .. autoattribute:: tasks
     .. autoattribute:: pool
+    .. autoattribute:: producer_pool
     .. autoattribute:: Task
     .. autoattribute:: timezone