diff --git a/shared/channels/src/channels/amqp_helpers.py b/shared/channels/src/channels/amqp_helpers.py index 82a554bbaff80dc96be0192492df2cec8e921d48..6799da83171899d6b8fa0237719118a2e2993a59 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)