Skip to content

About

[READ ONLY] Subtree split of the rate-limiter component (see hypervel/components)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

54 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Rate Limiter for Hypervel

Documentation: https://hypervel.org/docs/rate-limiting

Differences From Laravel

  • Hypervel provides rate limiting through the dedicated hypervel/rate-limiter package and Hypervel\RateLimiter namespace instead of Laravel's Cache component.
  • Hypervel uses immutable, typed rate limits. Limit defines a fixed window, CalendarWindow defines a window that resets at the start of each minute, hour, day or month, SlidingWindow defines a weighted sliding window, LeakyBucket defines a GCRA-backed leaky bucket, Unlimited bypasses storage, and Backoff defines failure-driven exponential delays. Use globally() instead of Laravel's GlobalLimit class.
  • The consume, consumeMany, inspect, attempt, recordFailure, and clear methods replace Laravel's split primitive counter API.
  • Rate limit keys are always hashed and include the rate limit type, its stable algorithm settings, and its global scope. Cost and callbacks do not affect identity. Changing identity settings starts new state, and clear() must receive the same settings that created the state.
  • Weighted denials report the actual unused capacity. The attempt() method consumes before invoking its callback and retains the charge if the callback throws.
  • Redis is selected through the normal rate limiter store API. Hypervel does not provide Redis-specific routing or queue middleware classes, a throttleWithRedis() switch, a redis argument on Middleware::throttleApi(), or a way to disable key hashing.

About

[READ ONLY] Subtree split of the rate-limiter component (see hypervel/components)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages