Skip to content

Core\RateLimit

Limits how often something may happen for one key, such as one account or one API key. consume counts in the shared store, so every server gives the same result. consumeLocally counts in the memory of this server process only. It is faster, and it is useful to turn away extra requests when the server is busy. Both return a Core\RateLimit\Decision.

Members

2 members.

MemberSignature
consumeconsume(string $key, uint $limit, Core\Time\Duration $per, { burst?: uint, cost?: uint }): Core\RateLimit\Decision
consumeLocallyconsumeLocally(string $key, uint $limit, Core\Time\Duration $per, { burst?: uint, cost?: uint }): Core\RateLimit\Decision