Interface MethodsCustomRateLimitResolver

All Known Implementing Classes:
MethodsCustomRateLimitResolver.Default

public interface MethodsCustomRateLimitResolver
Custom rate limit resolver.

When you need to adjust the rate limits for some reason, you can implement this interface and pass it to MethodsConfig#setCustomRateLimitResolver() method. With that, you can override the allowed requests per minute for selected methods.

  • Field Details

  • Method Details

    • getCustomAllowedRequestsPerMinute

      Optional<Integer> getCustomAllowedRequestsPerMinute(String teamId, String methodName)
      Return a present value only when you want to override the allowed requests per minute. Otherwise, returning Optional.empty() will result in falling back to the built-in calculation.
      Parameters:
      teamId - the workspace ID
      methodName - the method name such as "auth.test"
      Returns:
      the number of allowed requests per minute
    • getCustomAllowedRequestsForChatPostMessagePerMinute

      Optional<Integer> getCustomAllowedRequestsForChatPostMessagePerMinute(String teamId, String channel)
      Return a present value only when you want to override the allowed requests per minute. Otherwise, returning Optional.empty() will result in falling back to the built-in calculation.
      Parameters:
      teamId - the workspace ID
      channel - either a channel ID or channel name
      Returns:
      the number of allowed requests per minute
    • getCustomAllowedRequestsForAssistantThreadsSetStatusPerMinute

      Optional<Integer> getCustomAllowedRequestsForAssistantThreadsSetStatusPerMinute(String teamId, String channel)
      Return a present value only when you want to override the allowed requests per minute. Otherwise, returning Optional.empty() will result in falling back to the built-in calculation.
      Parameters:
      teamId - the workspace ID
      channel - either a channel ID or channel name
      Returns:
      the number of allowed requests per minute