createSlidingWindowRateLimitPolicy()
Create one exact scoped sliding-window-v1 policy from an already-identifiable request.
Import
Section titled “Import”import { createSlidingWindowRateLimitPolicy } from "@graphrefly/ts/rate-limit";Signature
Section titled “Signature”function createSlidingWindowRateLimitPolicy( requestValue: unknown, opts: CreateSlidingWindowRateLimitPolicyOptions,): SlidingWindowRateLimitPolicyParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
requestValue | unknown | Complete strict request that establishes the exact scope. |
opts | CreateSlidingWindowRateLimitPolicyOptions | State revision, capacity, exact window, and bounded ledger size. |
Returns
Section titled “Returns”The immutable normalized sliding-window policy.
Example
Section titled “Example”import { createSlidingWindowRateLimitPolicy } from "@graphrefly/ts/rate-limit";Source
Section titled “Source”packages/ts/src/rate-limit/keyed-rate-limit-algorithms.ts