def close(propagate = true, normal = true, log = true, &block)
      final_status = normal ? :closed : :failed
      if ![:closed, :failed].include?(@status)
        begin
          logger.info("[stop] Closed connection to broker #{@alias}") if log
          update_status(final_status) if propagate
          @connection.close do
            @status = final_status
            yield if block_given?
          end
        rescue StandardError => e
          logger.exception("Failed to close broker #{@alias}", e, :trace)
          @exception_stats.track("close", e)
          @status = final_status
          yield if block_given?
        end
      else
        @status = final_status
        yield if block_given?
      end
      true
    end
def close(propagate = true, normal = true, log = true, &block)
      final_status = normal ? :closed : :failed
      if ![:closed, :failed].include?(@status)
        begin
          logger.info("[stop] Closed connection to broker #{@alias}") if log
          update_status(final_status) if propagate
          @connection.close do
            @status = final_status
            yield if block_given?
          end
        rescue StandardError => e
          logger.exception("Failed to close broker #{@alias}", e, :trace)
          @exception_stats.track("close", e)
          @status = final_status
          yield if block_given?
        end
      else
        @status = final_status
        yield if block_given?
      end
      true
    end
Close broker connection

 === Parameters
 propagate(Boolean):: Whether to propagate connection status updates, defaults to true
 normal(Boolean):: Whether this is a normal close vs. a failed connection, defaults to true
 log(Boolean):: Whether to log that closing, defaults to true

 === Block
 Optional block with no parameters to be called after connection closed

 === Return
 true:: Always return true