Interface Ratelimiter

All Known Implementing Classes:
MemoryRatelimiter

public interface Ratelimiter
Ratelimiting for the gateway websockets, aka shards.
Since:
8/16/18.
Author:
amy
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.commons.lang3.tuple.ImmutablePair<Boolean,Long>
    checkRatelimit(String id, long periodMs, long limit)
    Checks if the id is ratelimited, based on the period and the limit-per-period.
  • Method Details

    • checkRatelimit

      org.apache.commons.lang3.tuple.ImmutablePair<Boolean,Long> checkRatelimit(String id, long periodMs, long limit)
      Checks if the id is ratelimited, based on the period and the limit-per-period.
      Parameters:
      id - id to check
      periodMs - period of ratelimit reset
      limit - max "uses" before ratelimit for a given period is hit
      Returns:
      A (isRatelimited, amountRemaining) tuple