Download the PHP package kwazaro/yii2-httpclient-requests-limit without Composer
On this page you can find all versions of the php package kwazaro/yii2-httpclient-requests-limit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download kwazaro/yii2-httpclient-requests-limit
More information about kwazaro/yii2-httpclient-requests-limit
Files in kwazaro/yii2-httpclient-requests-limit
Download kwazaro/yii2-httpclient-requests-limit
More information about kwazaro/yii2-httpclient-requests-limit
Files in kwazaro/yii2-httpclient-requests-limit
Vendor kwazaro
Package yii2-httpclient-requests-limit
Short Description This is the behavior for Yii2 Http Client, which provides rate limiting for requests per second or per minute. It is useful for connecting web services with rate limiting.
License BSD-3-Clause
Package yii2-httpclient-requests-limit
Short Description This is the behavior for Yii2 Http Client, which provides rate limiting for requests per second or per minute. It is useful for connecting web services with rate limiting.
License BSD-3-Clause
Please rate this library. Is it a good library?
Informations about the package yii2-httpclient-requests-limit
Yii2 Http Client requests limit behavior
This is the behavior for Yii2 Http Client, which provides rate limiting for requests per second or per minute. It is useful for connecting web services with rate limiting. This behavior uses Yii2 Redis extension to store rate-limiting info.
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
<?php
use kwazaro\yii2\httpclient\HttpClientRateLimitBehavior;
$client = new \yii\httpclient\Client([
'baseUrl' => 'https://example.com/api',
]);
$client->attachBehavior('requestsLimit', [
'class' => HttpClientRateLimitBehavior::class,
'redis' => 'redis', // ID of your Yii2 Redis component.
'redisKey' => 'myRequests', // Name of Redis key for storing data.
'maxRequestsPerSecond' => 10, // Max number of requests per second.
'maxRequestsPerMinute' => 100, // Max number of requests per minute.
]);
All versions of yii2-httpclient-requests-limit with dependencies
PHP Build Version
Package Version
Requires
yiisoft/yii2 Version
~2.0.0
yiisoft/yii2-httpclient Version ~2.0.0
yiisoft/yii2-redis Version ~2.0.0
yiisoft/yii2-httpclient Version ~2.0.0
yiisoft/yii2-redis Version ~2.0.0
The package kwazaro/yii2-httpclient-requests-limit contains the following files
Loading the files please wait ....