lib/amq/client/async/extensions/rabbitmq/confirm.rb in amq-client-0.7.0.alpha35 vs lib/amq/client/async/extensions/rabbitmq/confirm.rb in amq-client-0.8.0
- old
+ new
@@ -98,15 +98,15 @@
# @return [self] self.
#
# @see #confirm
def confirm_select(nowait = false, &block)
if nowait && block
- raise "You can't use Confirm.Select with nowait=true and a callback at the same time."
+ raise ArgumentError, "confirm.select with nowait = true and a callback makes no sense"
end
@uses_publisher_confirmations = true
- self.redefine_callback(:confirm_select, &block)
+ self.redefine_callback(:confirm_select, &block) unless nowait
@connection.send_frame(Protocol::Confirm::Select.encode(@id, nowait))
self
end
@@ -218,12 +218,12 @@
#
# @api public
# @see AMQ::Client::Exchange#publish
# @see AMQ::Client::Extensions::RabbitMQ::Channel#publisher_index
# @return [self] self
- def publish(*args)
+ def publish(*args, &block)
super(*args)
- @channel.after_publish(*args)
+ @channel.after_publish(*args, &block)
self
end # publish
end # ExchangeMixin
end # Confirm