MCPcopy Create free account
hub / github.com/apple/axlearn / close

Method close

axlearn/cloud/common/event_queue.py:186–195  ·  view source on GitHub ↗

Closes the RabbitMQ connection.

(self)

Source from the content-addressed store, hash-verified

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."""

Callers 5

_handle_publish_errorMethod · 0.95
_maybe_closeMethod · 0.45
_wait_and_close_procMethod · 0.45
teardownMethod · 0.45
stopMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected