php-http/throttle-plugin
PSR-7/PSR-18 HTTP client plugin that throttles outgoing requests to control rate and concurrency. Useful for API clients that must respect provider limits, avoid burst traffic, and smooth request flow.
PHP-HTTP plugin for throttling/rate limiting with the symfony/rate-limiter
Warning: Plugin currently utilizes usleep() and hence is blocking whole process while waiting
Via Composer
composer require php-http/throttle-plugin
new \Http\Client\Common\Plugin\ThrottlePlugin(
(new \Symfony\Component\RateLimiter\RateLimiterFactory(
['id' => 'foo', 'policy' => 'fixed_window', 'limit' => 2, 'interval' => '3 seconds'],
new \Symfony\Component\RateLimiter\Storage\InMemoryStorage(),
))->create(),
);
MIT license. Please see License File for more information.
How can I help you explore Laravel packages today?