Context used to acquire a producer from the pool. For use within a :keyword:`with` statement to get a producer from the pool if one is not already provided Arguments: producer (kombu.Producer): If not provided, a producer will be acquired from th
(self, producer=None)
| 1089 | default_connection = connection_or_acquire class="cm"># XXX compat |
| 1090 | |
| 1091 | def producer_or_acquire(self, producer=None): |
| 1092 | class="st">"""Context used to acquire a producer from the pool. |
| 1093 | |
| 1094 | For use within a :keyword:`with` statement to get a producer |
| 1095 | from the pool if one is not already provided |
| 1096 | |
| 1097 | Arguments: |
| 1098 | producer (kombu.Producer): If not provided, a producer |
| 1099 | will be acquired from the producer pool. |
| 1100 | class="st">""" |
| 1101 | return FallbackContext( |
| 1102 | producer, self.producer_pool.acquire, block=True, |
| 1103 | ) |
| 1104 | |
| 1105 | default_producer = producer_or_acquire class="cm"># XXX compat |
| 1106 |