Skip to content

Commit 3e6627e

Browse files
authored
Merge pull request #1 from php-http/cleanup-readme
2 parents 02ea9b8 + 4058123 commit 3e6627e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# throttle-plugin
1+
# Throttle Plugin
2+
23
PHP-HTTP plugin for throttling/rate limiting with the [symfony/rate-limiter](https://symfony.com/doc/current/rate_limiter.html)
34

45
> Warning: Plugin currently utilizes usleep() and hence is blocking whole process while waiting
@@ -8,19 +9,18 @@ PHP-HTTP plugin for throttling/rate limiting with the [symfony/rate-limiter](htt
89
Via [Composer](https://getcomposer.org/doc/00-intro.md)
910

1011
```bash
11-
composer require phphttp-plugin/throttle
12+
composer require php-http/throttle-plugin
1213
```
14+
1315
## Usage
1416

1517
```php
16-
new \Http\Client\Common\PluginClient($psr18Client, [
17-
new \Http\Client\Common\Plugin\ThrottlePluginn(
18-
(new \Symfony\Component\RateLimiter\RateLimiterFactory(
19-
['id' => 'foo', 'policy' => 'fixed_window', 'limit' => 2, 'interval' => '3 seconds'],
20-
new \Symfony\Component\RateLimiter\Storage\InMemoryStorage(),
21-
))->create(),
22-
),
23-
]);
18+
new \Http\Client\Common\Plugin\ThrottlePluginn(
19+
(new \Symfony\Component\RateLimiter\RateLimiterFactory(
20+
['id' => 'foo', 'policy' => 'fixed_window', 'limit' => 2, 'interval' => '3 seconds'],
21+
new \Symfony\Component\RateLimiter\Storage\InMemoryStorage(),
22+
))->create(),
23+
);
2424
```
2525

2626
## Licensing

0 commit comments

Comments
 (0)