lib/bunny/session.rb in bunny-1.7.1 vs lib/bunny/session.rb in bunny-2.0.0.rc1
- old
+ new
@@ -282,23 +282,19 @@
@reader_loop = nil
self.start_reader_loop if threaded?
rescue TCPConnectionFailed => e
-
@logger.warn e.message
-
self.initialize_transport
+ @logger.warn "Will try to connect to the next endpoint in line: #{@transport.host}:#{@transport.port}"
- @logger.warn "Retrying connection on next host in line: #{@transport.host}:#{@transport.port}"
-
return self.start
rescue
@status_mutex.synchronize { @status = :not_connected }
raise
end
-
rescue HostListDepleted
self.reset_host_index
@status_mutex.synchronize { @status = :not_connected }
raise TCPConnectionFailedForAllHosts
end
@@ -938,10 +934,15 @@
end # send_frameset_without_timeout(frames)
# @return [String]
# @api public
def to_s
- "#<#{self.class.name}:#{object_id} #{@user}@#{host}:#{@port}, vhost=#{@vhost}, hosts=[#{@hosts.join(',')}]>"
+ oid = ("0x%x" % (self.object_id << 1))
+ "#<#{self.class.name}:#{oid} #{@user}@#{host}:#{@port}, vhost=#{@vhost}, hosts=[#{@hosts.join(',')}]>"
+ end
+
+ def inspect
+ to_s
end
protected
# @private