Skip to content

Commit

Permalink
Merge pull request #1264 from AndyMender/1262_delivery_tag_types
Browse files Browse the repository at this point in the history
Make `delivery_tag` default to `0` in `Channel` and `BlockingChannel`
  • Loading branch information
lukebakken committed Jan 27, 2021
2 parents a548024 + ca4d5a4 commit aa609f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pika/adapters/blocking_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2111,7 +2111,7 @@ def basic_ack(self, delivery_tag=0, multiple=False):
self._impl.basic_ack(delivery_tag=delivery_tag, multiple=multiple)
self._flush_output()

def basic_nack(self, delivery_tag=None, multiple=False, requeue=True):
def basic_nack(self, delivery_tag=0, multiple=False, requeue=True):
"""This method allows a client to reject one or more incoming messages.
It can be used to interrupt and cancel large incoming messages, or
return untreatable messages to their original queue.
Expand Down Expand Up @@ -2299,7 +2299,7 @@ def basic_recover(self, requeue=False):
requeue=requeue, callback=recover_ok_result.signal_once)
self._flush_output(recover_ok_result.is_ready)

def basic_reject(self, delivery_tag=None, requeue=True):
def basic_reject(self, delivery_tag=0, requeue=True):
"""Reject an incoming message. This method allows a client to reject a
message. It can be used to interrupt and cancel large incoming messages,
or return untreatable messages to their original queue.
Expand Down
4 changes: 2 additions & 2 deletions pika/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def basic_get(self, queue, callback, auto_ack=False):
# frames (or similar)
self._send_method(spec.Basic.Get(queue=queue, no_ack=auto_ack))

def basic_nack(self, delivery_tag=None, multiple=False, requeue=True):
def basic_nack(self, delivery_tag=0, multiple=False, requeue=True):
"""This method allows a client to reject one or more incoming messages.
It can be used to interrupt and cancel large incoming messages, or
return untreatable messages to their original queue.
Expand Down Expand Up @@ -472,7 +472,7 @@ def basic_qos(self,
spec.Basic.Qos(prefetch_size, prefetch_count, global_qos), callback,
[spec.Basic.QosOk])

def basic_reject(self, delivery_tag, requeue=True):
def basic_reject(self, delivery_tag=0, requeue=True):
"""Reject an incoming message. This method allows a client to reject a
message. It can be used to interrupt and cancel large incoming messages,
or return untreatable messages to their original queue.
Expand Down

0 comments on commit aa609f3

Please sign in to comment.