php-http/throttle-plugin

Throttle/request limiter plugin for HTTPlug

Package info

github.com/php-http/throttle-plugin

pkg:composer/php-http/throttle-plugin

Statistics

Installs: 14 992

Dependents: 1

Suggesters: 0

Stars: 2

Open Issues: 1

1.1.0 2024-06-14 14:42 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 768040c4d3b1fc9db15d2e2a2b8f69d215e35aea

  • Gabriel Ostrolucký <gabriel.ostrolucky.woop@gmail.com>

httppluginthrottleratelimithttplug

This package is auto-updated.

Last update: 2026-06-14 19:17:55 UTC


README

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

Install

Via Composer

composer require php-http/throttle-plugin

Usage

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(),
);

Licensing

MIT license. Please see License File for more information.