diff --git a/coolamqp/attaches/consumer.py b/coolamqp/attaches/consumer.py index dae02c08f6f00a85c2fe7adab8d5fddc28cfb2c4..d75e753b29770a9e6ba961f65d5072c4d1abf9a6 100644 --- a/coolamqp/attaches/consumer.py +++ b/coolamqp/attaches/consumer.py @@ -26,21 +26,19 @@ EMPTY_MEMORYVIEW = memoryview(b'') # for empty messages class BodyReceiveMode(object): - # ZC - zero copy - # C - copy (copies every byte once) - - BYTES = 0 # message.body will be a single bytes object - # this will gather frames as memoryviews, and b''.join() them upon - # receiving last frame - # this is C - - MEMORYVIEW = 1 # message.body will be returned as a memoryview object - # this is ZC for small messages, and C for multi-frame ones - # think less than 800B, since 2048 is the buffer for socket recv, and an - # AMQP frame (or many frames!) have to fit there - - LIST_OF_MEMORYVIEW = 2 # message.body will be returned as list of - # memoryview objects these constitute received pieces. this is always ZC + #: # message.body will be a single bytes object + #: this will gather frames as memoryviews, and b''.join() them upon receiving last frame + BYTES = 0 + + #: message.body will be returned as a memoryview object. This is zero-copy for small messages and once-copy for + #: bigger ones + #: think less than 800B, since 2048 is the buffer for socket recv, and an + #: AMQP frame (or many frames!) have to fit there + MEMORYVIEW = 1 + + #: message.body will be returned as list of memoryviews. memoryview objects these constitute received pieces. + #: this is fastest, and always zero-copy + LIST_OF_MEMORYVIEW = 2 class Consumer(Channeler): diff --git a/coolamqp/clustering/cluster.py b/coolamqp/clustering/cluster.py index 39305772782cfcfc06345dfca0c58cfbd85c29e5..f1e7342719680ae73077e128b4f62c399d07ec74 100644 --- a/coolamqp/clustering/cluster.py +++ b/coolamqp/clustering/cluster.py @@ -195,6 +195,8 @@ class Cluster(object): .. note:: You don't need to explicitly declare queues and exchanges that you will be using beforehand, this will do this for you on the same channel. + If accepts more arguments. Consult :class:`coolamqp.attaches.consumer.Consumer` for details. + :param queue: Queue object, being consumed from right now. Note that name of anonymous queue might change at any time! :param on_message: callable that will process incoming messages @@ -261,7 +263,7 @@ class Cluster(object): it will be discarded :param span: optionally, current span, if opentracing is installed :param dont_trace: if set to True, a span won't be generated - :return: Future to be finished on completion or None, is confirm/tx was not chosen + :return: Future to be finished on completion or None, is confirm was not chosen """ if self.tracer is not None and not dont_trace: span = self._make_span('publish', span)