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

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

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

origin: com.scireum/sirius-kernel

/**
 * Creates a new time based rate limit.
 * <p>
 * Calling {@link #check()} on will only return <tt>true</tt> every after the given amount of time has be passed
 * since the last time it returned <tt>true</tt>. Returns <tt>false</tt> otherwise.
 *
 * @param interval the amount of time after a call to {@link #check()} returns <tt>true</tt> again
 * @param unit     the unit for amount
 * @return a new time based rate limit
 */
public static RateLimit timeInterval(long interval, TimeUnit unit) {
  return nTimesPerInterval(interval, unit, 1);
}
sirius.kernel.commonsRateLimitnTimesPerInterval

Javadoc

Creates a new time based rate limit which permits up to N calls per interval.

Calling #check() on will only return true N times in every given interval, false otherwise.

Popular methods of RateLimit

  • check
    Checks whether the rate limit constraints permit another call or not.
  • timeInterval
    Creates a new time based rate limit. Calling #check() on will only return true every after the given
  • <init>

Popular in Java

  • Finding current android device location
  • getContentResolver (Context)
  • getSupportFragmentManager (FragmentActivity)
  • setRequestProperty (URLConnection)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Top 12 Jupyter Notebook extensions
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