Tabnine Logo
RateLimit.timeInterval
Code IndexAdd Tabnine to your IDE (free)

How to use
timeInterval
method
in
sirius.kernel.commons.RateLimit

Best Java code snippets using sirius.kernel.commons.RateLimit.timeInterval (Showing top 3 results out of 315)

origin: com.scireum/sirius-search

RateLimit rateLimit = RateLimit.timeInterval(1, TimeUnit.SECONDS);
origin: com.scireum/sirius-search

private void executeScroll(SearchResponse initialSearchResponse,
              ResultHandler<? super E> handler,
              EntityDescriptor entityDescriptor) {
  SearchResponse searchResponse = initialSearchResponse;
  TaskContext ctx = TaskContext.get();
  RateLimit rateLimit = RateLimit.timeInterval(1, TimeUnit.SECONDS);
  long lastScroll = 0;
  Limit lim = new Limit(start, limit);
  while (true) {
    lastScroll = performScrollMonitoring(lastScroll);
    for (SearchHit hit : searchResponse.getHits()) {
      if (!processHit(handler, entityDescriptor, ctx, rateLimit, lim, hit)) {
        return;
      }
    }
    if (searchResponse.getHits().getHits().length == 0) {
      return;
    }
    searchResponse = scrollFurther(entityDescriptor, searchResponse.getScrollId());
  }
}
origin: com.scireum/sirius-db

try {
  TaskContext ctx = TaskContext.get();
  RateLimit rateLimit = RateLimit.timeInterval(1, TimeUnit.SECONDS);
  Limit effectiveLimit = new Limit(skip, limit);
  scrollResponse = executeScroll(entity -> {
sirius.kernel.commonsRateLimittimeInterval

Javadoc

Creates a new time based rate limit.

Calling #check() on will only return true every after the given amount of time has be passed since the last time it returned true. Returns false otherwise.

Popular methods of RateLimit

  • check
    Checks whether the rate limit constraints permit another call or not.
  • <init>
  • nTimesPerInterval
    Creates a new time based rate limit which permits up to N calls per interval. Calling #check() on w

Popular in Java

  • Start an intent from android
  • getSystemService (Context)
  • getContentResolver (Context)
  • setRequestProperty (URLConnection)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • String (java.lang)
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Table (org.hibernate.mapping)
    A relational table
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now