def _init_requester
      if circuit_breaker_enabled?
        @_requester = Utils::CircuitBreaker.new(
          threshold: error_threshold, retry_period: retry_period
        ) { |*args| _request(*args) }

        @_requester.on_open do
          logger.error("circuit opened for #{name}")
        end

        @_requester.on_close do
          logger.info("circuit closed for #{name}")
        end
      else
        @_requester = proc { |*args| _request(*args) }
      end
    end
def _init_requester
      if circuit_breaker_enabled?
        @_requester = Utils::CircuitBreaker.new(
          threshold: error_threshold, retry_period: retry_period
        ) { |*args| _request(*args) }

        @_requester.on_open do
          logger.error("circuit opened for #{name}")
        end

        @_requester.on_close do
          logger.info("circuit closed for #{name}")
        end
      else
        @_requester = proc { |*args| _request(*args) }
      end
    end
Sets up the circuit breaker for making requests to the service.

 Any exception raised by the `_request` method will count as a failure for
 the circuit breaker.  Once the threshold for errors has been reached, the
 circuit opens and all subsequent requests will raise a CircuitOpenError.

 When the circuit is opened or closed, a message is sent to the logger for
 the client.