Class RateLimiter

java.lang.Object
com.erudika.para.core.utils.RateLimiter

public class RateLimiter extends Object
A simple rate limiter implemented using the sliding window counter algorithm.
Author:
Alex Bogdanovski [[email protected]]
  • Method Details

    • isAllowed

      public boolean isAllowed(String appid, String userId)
      Check if some action is allowed to be performed by a given user.
      Parameters:
      appid - the appid
      userId - the user identifier
      Returns:
      true if user is allowed to perform the action