diff --git a/coolamqp/clustering/cluster.py b/coolamqp/clustering/cluster.py index de021c52372aab7ef6646f79e59a509e3329cf4b..268deb4b5b1784d6a872bf7852bc00b362fc149c 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 5949d9c1c7642ade5ea7926d606a6e7ae9f18501..e64fb87c96c6dd58258076442c5d0e0ce5efddf1 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