From ae91c15160b15e050c197469c92975ce06111570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@ericsson.com> Date: Sat, 31 Aug 2024 15:26:28 +0200 Subject: [PATCH] docs fixed --- coolamqp/clustering/cluster.py | 2 ++ coolamqp/objects.py | 33 ++++++++++++++++----------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/coolamqp/clustering/cluster.py b/coolamqp/clustering/cluster.py index de021c5..268deb4 100644 --- a/coolamqp/clustering/cluster.py +++ b/coolamqp/clustering/cluster.py @@ -187,6 +187,8 @@ class Cluster(object): if you leave it at None, messages will be .put into self.events :param span: optional span, if opentracing is installed :param dont_trace: if True, this won't output a span + :param body_receive_mode: a :class:`coolamqp.attaches.consumer.BodyReceiveMode` to signal how to build the received + ` :class:`coolamqp.objects.ReceivedMessage` :return: a tuple (Consumer instance, and a Future), that tells, when consumer is ready """ if span is not None and not dont_trace: diff --git a/coolamqp/objects.py b/coolamqp/objects.py index 5949d9c..e64fb87 100644 --- a/coolamqp/objects.py +++ b/coolamqp/objects.py @@ -111,6 +111,22 @@ class ReceivedMessage(Message): Note that if the consumer that generated this message was no_ack, .ack() and .nack() are no-ops. + + :ivar body: message body. A stream of octets. + :type body: str (py2) or bytes (py3) or a list of memoryviews, if + particular disabled-by-default option is turned on, or a single memoryview + :param exchange_name: name of exchange this message was submitted to or a memoryview + :param routing_key: routing key with which this message was sent + :param properties: a suitable BasicContentPropertyList subinstance. + be prepared that value of properties that are + strings will be memoryviews + :param delivery_tag: delivery tag assigned by AMQP broker to confirm + this message + :param ack: a callable to call when you want to ack (via basic.ack) + this message. None if received by the no-ack mechanism + :param nack: a callable to call when you want to nack + (via basic.reject) this message. None if received by the no-ack + mechanism """ __slots__ = ('delivery_tag', 'exchange_name', 'routing_key', '_ack', '_nack', 'acked') @@ -123,23 +139,6 @@ class ReceivedMessage(Message): ack=None, # type: tp.Callable[[], None] nack=None # type: tp.Callable[[], None] ): - """ - :param body: message body. A stream of octets. - :type body: str (py2) or bytes (py3) or a list of memoryviews, if - particular disabled-by-default option is turned on, or a single memoryview - :param exchange_name: name of exchange this message was submitted to - :param routing_key: routing key with which this message was sent - :param properties: a suitable BasicContentPropertyList subinstance. - be prepared that value of properties that are - strings will be memoryviews - :param delivery_tag: delivery tag assigned by AMQP broker to confirm - this message - :param ack: a callable to call when you want to ack (via basic.ack) - this message. None if received by the no-ack mechanism - :param nack: a callable to call when you want to nack - (via basic.reject) this message. None if received by the no-ack - mechanism - """ Message.__init__(self, body, properties=properties) self.delivery_tag = delivery_tag -- GitLab