lib/bunny/channel.rb in bunny-2.2.2 vs lib/bunny/channel.rb in bunny-2.3.0
- old
+ new
@@ -616,18 +616,18 @@
# keep blocking the thread that calls it without clear way to constantly unblock it
# from the network activity loop (where recovery happens) with the current continuations
# implementation (and even more correct and convenient ones, such as wait/notify, should
# we implement them). So we return a triple of nils immediately which apps should be
# able to handle anyway as "got no message, no need to act". MK.
- @last_basic_get_response = if @connection.open?
- wait_on_basic_get_continuations
- else
- [nil, nil, nil]
- end
+ last_basic_get_response = if @connection.open?
+ wait_on_basic_get_continuations
+ else
+ [nil, nil, nil]
+ end
raise_if_continuation_resulted_in_a_channel_error!
- @last_basic_get_response
+ last_basic_get_response
end
# prefetch_count is of type short in the protocol. MK.
MAX_PREFETCH_COUNT = (2 ** 16) - 1
@@ -703,11 +703,11 @@
# conn = Bunny.new
# conn.start
#
# ch = conn.create_channel
# q.subscribe do |delivery_info, properties, payload|
- # # requeue the message
+ # # reject the message
# ch.basic_reject(delivery_info.delivery_tag, false)
# end
#
# @example Requeue a message fetched via basic.get
# conn = Bunny.new
@@ -1486,11 +1486,11 @@
# Recovers basic.qos setting, exchanges, queues and consumers. Used by the Automatic Network Failure
# Recovery feature.
#
# @api plugin
def recover_from_network_failure
- @logger.debug "Recovering channel #{@id} after network failure"
+ @logger.debug { "Recovering channel #{@id} after network failure" }
release_all_continuations
recover_prefetch_setting
recover_confirm_mode
recover_tx_mode
@@ -1542,22 +1542,22 @@
# Recovery feature.
#
# @api plugin
def recover_queues
@queues.values.dup.each do |q|
- @logger.debug "Recovering queue #{q.name}"
+ @logger.debug { "Recovering queue #{q.name}" }
q.recover_from_network_failure
end
end
# Recovers consumers. Used by the Automatic Network Failure
# Recovery feature.
#
# @api plugin
def recover_consumers
unless @consumers.empty?
- @work_pool = ConsumerWorkPool.new(@work_pool.size)
+ @work_pool = ConsumerWorkPool.new(@work_pool.size, @work_pool.abort_on_exception)
@work_pool.start
end
@consumers.values.dup.each do |c|
c.recover_from_network_failure
end
@@ -1614,10 +1614,10 @@
end
end
# @private
def handle_method(method)
- @logger.debug "Channel#handle_frame on channel #{@id}: #{method.inspect}"
+ @logger.debug { "Channel#handle_frame on channel #{@id}: #{method.inspect}" }
case method
when AMQ::Protocol::Queue::DeclareOk then
@continuations.push(method)
when AMQ::Protocol::Queue::DeleteOk then
@continuations.push(method)