@openpit/engine
    Preparing search index...

    Class RateLimit

    Rate-limit configuration: a maximum order count over a rolling window.

    Index
    • Constructs a rate limit from a max order count and a window.

      windowMs is the rolling-window length in milliseconds. Fractional milliseconds retain nanosecond precision.

      Errors

      Throws TypeError when maxOrders is not a number, or RangeError when maxOrders is not an exact non-negative integer in the supported range or windowMs cannot be represented as a native duration. Positive and maximum-window validation is performed by the core settings constructor when the policy is built.

      Parameters

      • max_orders: number
      • window_ms: number

      Returns RateLimit

    maxOrders: number

    The maximum number of orders accepted within the window.

    windowMs: number

    The rolling-window length in milliseconds.

    • Returns void

    • Returns a fresh copy of this rate limit.

      Returns RateLimit

    • Returns void