Closes the RabbitMQ connection.
(self)
| 184 | raise e |
| 185 | |
| 186 | def close(self): |
| 187 | """Closes the RabbitMQ connection.""" |
| 188 | if self._connection and not self._connection.is_closed: |
| 189 | self._connection.close() |
| 190 | logging.info("Closed RabbitMQ connection.") |
| 191 | if self._channel and not self._channel.is_closed: |
| 192 | self._channel.close() |
| 193 | logging.info("Closed RabbitMQ channel.") |
| 194 | self._connection = None |
| 195 | self._channel = None |
| 196 | |
| 197 | def publish(self, event: Event): |
| 198 | """Publishes an event to the queue.""" |
no outgoing calls
no test coverage detected