hypervel / rate-limiter
Atomic rate limiting for Hypervel applications.
0.4.x-dev
2026-10-13 08:56 UTC
Requires
- php: ^8.4
- ext-swoole: ^6.3.0RC1
- hypervel/collections: ^0.4
- hypervel/console: ^0.4
- hypervel/container: ^0.4
- hypervel/contracts: ^0.4
- hypervel/coordinator: ^0.4
- hypervel/core: ^0.4
- hypervel/database: ^0.4
- hypervel/macroable: ^0.4
- hypervel/redis: ^0.4
- hypervel/support: ^0.4
- psr/log: ^3.0
- symfony/console: ^8.1.2
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-27 07:31:17 UTC
README
Documentation: https://hypervel.org/docs/rate-limiting
Differences From Laravel
- Hypervel provides rate limiting through the dedicated
hypervel/rate-limiterpackage andHypervel\RateLimiternamespace instead of Laravel's Cache component. - Hypervel uses immutable, typed rate limits.
Limitdefines a fixed window,CalendarWindowdefines a window that resets at the start of each minute, hour, day or month,SlidingWindowdefines a weighted sliding window,LeakyBucketdefines a GCRA-backed leaky bucket,Unlimitedbypasses storage, andBackoffdefines failure-driven exponential delays. Useglobally()instead of Laravel'sGlobalLimitclass. - The
consume,consumeMany,inspect,attempt,recordFailure, andclearmethods 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, aredisargument onMiddleware::throttleApi(), or a way to disable key hashing.