diff --git a/Changes b/Changes index dfebc36..caa66c3 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ Revision history for Perl extension AnyEvent::RabbitMQ + - Add "no_ack" flag to "get" method. (Julio Polo) - Prevent channelMax from overflowing. https://rt.cpan.org/Ticket/Display.html?id=97716 (Carl Hörberg) - Merge in documentation patch from diff --git a/dist.ini b/dist.ini index 470b1ab..5e6d7dc 100644 --- a/dist.ini +++ b/dist.ini @@ -15,6 +15,7 @@ x_contributors = Ruslan Zakirov x_contributors = Masahito Ikuta x_contributors = Rod Taylor x_contributors = Carl Hörberg +x_contributors = Julio Polo [InstallGuide] [CPANFile] diff --git a/lib/AnyEvent/RabbitMQ/Channel.pm b/lib/AnyEvent/RabbitMQ/Channel.pm index 50d4f63..4edd382 100644 --- a/lib/AnyEvent/RabbitMQ/Channel.pm +++ b/lib/AnyEvent/RabbitMQ/Channel.pm @@ -617,12 +617,14 @@ sub get { my $self = shift; my ($cb, $failure_cb, %args) = $self->_delete_cbs(@_); + my $no_ack = delete $args{no_ack} // 1; + return $self if !$self->_check_open($failure_cb); $self->{connection}->_push_write_and_read( 'Basic::Get', { - no_ack => 1, + no_ack => $no_ack, %args, # queue ticket => 0, }, @@ -1385,6 +1387,10 @@ a notification that there was nothing to collect from the queue. This callback will be called if an error is signalled on this channel. +=item no_ack + +0 or 1, default 1 + =back =head2 ack