saloonphp / rate-limit-plugin
Handle rate limits beautifully in your Saloon API integrations or SDKs
Installs: 413 404
Dependents: 16
Suggesters: 0
Security: 0
Stars: 15
Watchers: 2
Forks: 0
Open Issues: 5
Requires
- php: ^8.1
- saloonphp/saloon: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- mockery/mockery: ^1.5
- orchestra/testbench: ^8.5
- pestphp/pest: ^2.6
- phpstan/phpstan: ^1.9
- predis/predis: ^2.1
- psr/simple-cache: ^3.0
- spatie/ray: ^1.33
README
Handling rate limits can be hard. This first-party plugin provides you with the tools you need to prevent rate-limits and handle what happens if a rate-limit is exceeded. This plugin allows you to define limits on your connector/request.
Available Stores
- In-Memory (Array)
- File
- Redis
- Predis
- PSR Cache Store
- Laravel Cache Store
With this plugin, you are be able to define various limits on a per-integration basis. You can also control if Saloon should throw an exception or sleep if a limit is reached. Saloon will keep track of how many requests are made and when a rate-limit is hit, Saloon will prevent further requests on the connector/request until the rate limit has been lifted.
Installation
You can install the cache plugin through Composer.
composer require saloonphp/rate-limit-plugin "^2.0"