Module bus.limiter

Annotation Interface Limiting


@Inherited @Documented @Retention(RUNTIME) @Target(METHOD) public @interface Limiting
Annotation for marking methods that require request limiting. This annotation is used to control the rate of incoming requests to a method, preventing it from being overwhelmed.
Since:
Java 17+
Author:
Kimi Liu
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    int
    Specifies the maximum number of requests allowed within a defined duration.
    int
    Specifies the time window in seconds during which the count() is applied.
  • Element Details

    • count

      int count
      Specifies the maximum number of requests allowed within a defined duration.
      Returns:
      The maximum request count.
    • duration

      int duration
      Specifies the time window in seconds during which the count() is applied.
      Returns:
      The duration in seconds for the limiting window.