Browse Source

Adds app.producer_pool alias to app.amqp.producer_pool

Ask Solem 9 years ago
parent
commit
ff57c80f37
2 changed files with 6 additions and 1 deletions
  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