How do I inspect rate limit usage without consuming a request? #28
-
|
I need to show remaining capacity in a UI but should not spend a request. Which method is read-only? |
Beta Was this translation helpful? Give feedback.
Answered by
shnwazdeveloper
May 10, 2026
Replies: 1 comment
-
|
Use |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
clyxudev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use
limiter.snapshot(key)to read the current bucket without adding cost. It returnslimit,used,remaining, andresetAt.check(key, cost)also does not mutate the bucket, whileconsume()andassert()do consume capacity when allowed.