From 8fc34949f8b946190d41f4ba6d47b0f0ba1fb586 Mon Sep 17 00:00:00 2001 From: nhertz <nhertz@nrao.edu> Date: Fri, 11 Sep 2020 10:36:54 -0600 Subject: [PATCH] Added some comments --- shared/channels/src/channels/amqp_helpers.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/shared/channels/src/channels/amqp_helpers.py b/shared/channels/src/channels/amqp_helpers.py index 82a554bba..6799da831 100644 --- a/shared/channels/src/channels/amqp_helpers.py +++ b/shared/channels/src/channels/amqp_helpers.py @@ -92,10 +92,17 @@ class Channel(Protocol[T]): self.definition.declarations(self.CHANNEL) def close(self): + """ + Close connection to RabbitMQ server, if it's open + """ if self.CONNECTION: self.CONNECTION.close() def send(self, event: WorkflowEventSchema): + """ + Send a given WorkflowEvent to the exchange + :param event: The marshmallow schema of the event to be sent + """ rendered = self.definition.schema.dump(event) routing_key = self.definition.routing_key_for(event) self.CHANNEL.basic_publish(routing_key=routing_key, body=rendered) -- GitLab