The method used to rate-limit network requests. Can be either
<code>debounce</code> or <code>throttle</code>. Defaults to
<code>debounce</code>.

@param eRateLimitBy
function to use. May not be <code>null</code>.
@return this
347462
@Nonnull
  public BloodhoundRemote setRateLimitBy (@Nonnull final EBloodhoundRemoteRateLimitBy eRateLimitBy)
  {
    m_eRateLimitBy = ValueEnforcer.notNull (eRateLimitBy, "RateLimitBy");
    return this;
  }
350372
function throttleMiddleware (request, response, next) {
    var ip = null

    if (config.useCustomHeader && request.headers[config.useCustomHeader]) {
      ip = request.headers[config.useCustomHeader]
    } else {
      ip = request.headers['x-forwarded-for'] ||
        request.connection.remoteAddress ||
        request.socket.remoteAddress ||
        request.connection.socket.remoteAddress || ''

      ip = ip.split(',')[0]
      if (!ipRegex().test(ip) || ip.substr(0, 7) === '::ffff:' || ip === '::1') {
        ip = '127.0.0.1'
      } else {
        ip = ip.match(ipRegex())[0]
      }
    }

    Throttle
      .findOneAndUpdate({ip: ip}, { $inc: { hits: 1 } }, { upsert: false })
      .exec(function (error, throttle) {
        if (errHandler(response, next, error)) { return }
        if (!throttle) {
          throttle = new Throttle({
            createdAt: new Date(),
            ip: ip
          })
          throttle.save(function (error, throttle) {
            // THERE'S NO ERROR, BUT THROTTLE WAS NOT SAVE
            if (!throttle && !error) {
              error = new Error('Error checking rate limit.')
            }

            if (errHandler(response, next, error)) { return }

            respondWithThrottle(request, response, next, throttle)
          })
        } else {
          respondWithThrottle(request, response, next, throttle)
        }
      })
  }
233643
@Deprecated
  public final NettyChannelBuilder enableKeepAlive(boolean enable, long keepAliveTime,
      TimeUnit delayUnit, long keepAliveTimeout, TimeUnit timeoutUnit) {
    if (enable) {
      return keepAliveTime(keepAliveTime, delayUnit)
          .keepAliveTimeout(keepAliveTimeout, timeoutUnit);
    }
    return keepAliveTime(KEEPALIVE_TIME_NANOS_DISABLED, TimeUnit.NANOSECONDS);
  }
496549
def _update_callsafety(self, response):
        
        if self.ratelimit is not None:
            self.callsafety['lastcalltime'] = time()
            self.callsafety['lastlimitremaining'] = int(response.headers.get('X-Rate-Limit-Remaining', 0))
1133125
function () {
        clearTimeout(this._conn._idleTimeout);
        this._throttledRequestHandler();
        this._conn._idleTimeout = setTimeout(this._conn._onIdle.bind(this._conn), 100);
    }
632496
@Deprecated
  public final OkHttpChannelBuilder enableKeepAlive(boolean enable) {
    if (enable) {
      return keepAliveTime(DEFAULT_KEEPALIVE_TIME_NANOS, TimeUnit.NANOSECONDS);
    } else {
      return keepAliveTime(KEEPALIVE_TIME_NANOS_DISABLED, TimeUnit.NANOSECONDS);
    }
  }
520896
@Override
    public Function<Service<HttpRequest, HttpResponse>,
            ? extends Service<HttpRequest, HttpResponse>> newDecorator(RateLimitingDecorator parameter) {
        return ThrottlingHttpService.newDecorator(new RateLimitingThrottlingStrategy<>(
                parameter.value(), DefaultValues.isSpecified(parameter.name()) ? parameter.name() : null));
    }
276671
public static <T> RateLimiterOperator<T> of(RateLimiter rateLimiter) {
        return of(rateLimiter, Schedulers.parallel());
    }
961958
def add_connection_throttle(self, maxConnectionRate=None,
            maxConnections=None, minConnections=None, rateInterval=None):
        
        if not any((maxConnectionRate, maxConnections, minConnections,
                rateInterval)):
            # Pointless call
            return
        return self.manager.add_connection_throttle(self,
                maxConnectionRate=maxConnectionRate, maxConnections=maxConnections,
                minConnections=minConnections, rateInterval=rateInterval)
647521
function throttle(func, limit) {
        if (typeof func !== 'function') {
            throw new Error('function argument is expected');
        } else if (typeof limit !== 'number') {
            throw new Error('number argument is expected');
        }

        var listener = new ThrottleListener(limit);

        return function () {
            return listener.execute(func, this, arguments);
        };
    }
1160947
@Override
    public boolean enableImmediateResponseRead() {
        if (headersSent()) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Request hdrs already sent, too late for immediate read");
            }
            return false;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Immediate response read requested: " + getVC());
        }
        this.bImmediateRead = true;
        return true;
    }
1019859
public Reader<T> limit(final long limit) {
        this.limit = limit;

        if (this.pageSize == null) {
            this.pageSize = (new Long(this.limit)).intValue();
        }

        return this;
    }
1232200
@Nonnull
  public FineUploader5Validation setMinSizeLimit (@Nonnegative final int nMinSizeLimit)
  {
    ValueEnforcer.isGE0 (nMinSizeLimit, "MinSizeLimit");
    m_nValidationMinSizeLimit = nMinSizeLimit;
    return this;
  }
557280
function throttle(func) {
  var limit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;

  var wait = false;

  return function () {
    if (!wait) {
      func.call();
      wait = true;
      setTimeout(function () {
        wait = false;
      }, limit);
    }
  };
}
1109552
@Nonnull
  public static EChange setResponseCompressionEnabled (final boolean bResponseCompressionEnabled)
  {
    return s_aRWLock.writeLocked ( () -> {
      if (s_bResponseCompressionEnabled == bResponseCompressionEnabled)
        return EChange.UNCHANGED;
      s_bResponseCompressionEnabled = bResponseCompressionEnabled;
      LOGGER.info ("CompressFilter responseCompressionEnabled=" + bResponseCompressionEnabled);
      return EChange.CHANGED;
    });
  }
905219
protected function doProcess(Exchange $exchange, SerializableArray $processingContext)
    {
        $this->checkReset();

        if (!$this->shouldPass($exchange)) {
            if ($this->isAsyncDelayed()) {
                $exception = new ThrottledException("This message can't be processed because the throttling limit is reached in processor with id: ".$this->getId());
            } else {
                $error = sprintf('Reached throttling limit in processor "%s"', $this->id);
                $exception = new ThrottlingLimitReachedException($error);
            }
            throw $exception;
        } else {
            $exchange->getItinerary()->prepend($this->itinerary);
            $this->increaseCounter();
        }
    }
616198
function ()
    {
        if (!this._requests) {
            Strophe.debug("_throttledRequestHandler called with " +
                          "undefined requests");
        } else {
            Strophe.debug("_throttledRequestHandler called with " +
                          this._requests.length + " requests");
        }

        if (!this._requests || this._requests.length === 0) {
            return;
        }

        if (this._requests.length > 0) {
            this._processRequest(0);
        }

        if (this._requests.length > 1 &&
            Math.abs(this._requests[0].rid -
                     this._requests[1].rid) < this.window) {
            this._processRequest(1);
        }
    }