PHP code example of bentools / guzzle-throttle-middleware
1. Go to this page and download the library: Download bentools/guzzle-throttle-middleware library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bentools / guzzle-throttle-middleware example snippets
useApp\RequestMatcher\ExampleOrgRequestMatcher;
useBenTools\GuzzleHttp\Middleware\Storage\Adapter\ArrayAdapter;
useBenTools\GuzzleHttp\Middleware\ThrottleConfiguration;
useBenTools\GuzzleHttp\Middleware\ThrottleMiddleware;
useGuzzleHttp\Client;
useGuzzleHttp\HandlerStack;
ationInSeconds, 'example')
);
$stack->push($middleware, 'throttle');
$client = new Client([
'handler' => $stack,
]);
$client->get('http://www.example.org'); // Will be executed immediately
$client->get('http://www.example.org'); // Will be executed in 1 second
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.