php-http/throttle-plugin
最新稳定版本:1.1.0
Composer 安装命令:
composer require php-http/throttle-plugin
包简介
Throttle/request limiter plugin for HTTPlug
README 文档
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.
统计信息
- 总下载量: 11.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-23