Class AiUserRateLimiter

java.lang.Object
com.axelor.ai.chat.provider.AiUserRateLimiter

@Singleton public class AiUserRateLimiter extends Object
Per-user rate limiter, keyed by user code.
  • Constructor Details

    • AiUserRateLimiter

      public AiUserRateLimiter()
  • Method Details

    • acquire

      public void acquire(String key, Integer maxRps)
      Acquires a permit for the given key, blocking while the rate limit is reached. No-op when the key is null or the rate limit is null / non-positive.
      Parameters:
      key - unique identifier of what is limited
      maxRps - max requests per second