Skip to content
Snippets Groups Projects

fixed #9

Merged Piotr Maślanka requested to merge issue-#9 into milestone-2.0.0
2 files
+ 6
11
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -86,9 +86,6 @@ class Consumer(Channeler):
:type no_ack: bool
:param qos: maximum messages to send to client that can stay unacknowledged (qos.prefetch_count)
:type qos: int, prefetch_count to use
:param cancel_on_failure: Consumer will cancel itself when link goes
down
:type cancel_on_failure: bool
:param future_to_notify: Future to succeed when this consumer goes
online for the first time.
This future can also raise with AMQPError if
@@ -110,13 +107,12 @@ class Consumer(Channeler):
__slots__ = ('queue', 'no_ack', 'on_message', 'cancelled', 'receiver',
'attache_group', 'channel_close_sent', 'qos', 'qos_update_sent',
'future_to_notify', 'future_to_notify_on_dead',
'fail_on_first_time_resource_locked', 'cancel_on_failure',
'fail_on_first_time_resource_locked',
'body_receive_mode', 'consumer_tag', 'on_cancel', 'on_broker_cancel',
'hb_watch', 'deliver_watch', 'span')
def __init__(self, queue, on_message, span=None,
no_ack=True, qos=0,
cancel_on_failure=False,
future_to_notify=None,
fail_on_first_time_resource_locked=False,
body_receive_mode=BodyReceiveMode.BYTES
@@ -148,7 +144,6 @@ class Consumer(Channeler):
self.future_to_notify_on_dead = None # .cancel
self.fail_on_first_time_resource_locked = fail_on_first_time_resource_locked
self.cancel_on_failure = cancel_on_failure
self.body_receive_mode = body_receive_mode
self.consumer_tag = None
@@ -240,9 +235,7 @@ class Consumer(Channeler):
Note, this can be called multiple times, and eventually with None.
"""
if self.cancel_on_failure and (not self.cancelled):
logger.debug(
'Consumer is cancel_on_failure and failure seen, True->cancelled')
if not self.cancelled:
self.cancelled = True
self.on_cancel()
Loading