Context used to acquire a connection from the pool. For use within a :keyword:`with` statement to get a connection from the pool if one is not already provided. Arguments: connection (kombu.Connection): If not provided, a connection will be acqui
(self, connection=None, pool=True, *_, **__)
| 1075 | return self.connection_for_write() |
| 1076 | |
| 1077 | def connection_or_acquire(self, connection=None, pool=True, *_, **__): |
| 1078 | """Context used to acquire a connection from the pool. |
| 1079 | |
| 1080 | For use within a :keyword:`with` statement to get a connection |
| 1081 | from the pool if one is not already provided. |
| 1082 | |
| 1083 | Arguments: |
| 1084 | connection (kombu.Connection): If not provided, a connection |
| 1085 | will be acquired from the connection pool. |
| 1086 | """ |
| 1087 | return FallbackContext(connection, self._acquire_connection, pool=pool) |
| 1088 | |
| 1089 | default_connection = connection_or_acquire # XXX compat |
| 1090 |