library tactician-rate-limit
Tactician command bus middleware for rate limiting command execution
lamoda/tactician-rate-limit
Tactician command bus middleware for rate limiting command execution
- Thursday, July 19, 2018
- by omnilight
- Repository
- 3 Watchers
- 2 Stars
- 0 Installations
- PHP
- 1 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
Lamoda Tactician Rate Limit Middleware
, (*1)
Installation
Usage is as simple as, (*2)
composer require lamoda/tactician-rate-limit
After that you need to choose library that is providing rate limiting capabilities.
For now there out of the box support for the following libraries:
* davedevelopment/stiphle, (*3)
To use this library do the following:, (*4)
- Require
stiphle
via composer:
bash
composer require davedevelopment/stiphle
-
Configure middleware:, (*5)
$rateLimitProvider = new MatchingCommandClassRateLimitProvider(
RateLimitedCommand::class,
3, // max commands to execute per interval
1000 // interval in milliseconds
);
$rateLimiter = new StiphleRateLimiterAdapter(new LeakyBucket());
$rateLimitMiddleware = new RateLimitMiddleware(
$rateLimitProvider,
$rateLimiter
);
// Create command bus with this middleware:
$commandBus = new CommandBus([
$rateLimitMiddleware,
// other middlewares
]);
If you are using Symfony: use
lamoda/tactician-rate-limit-bundle, (*6)
dev-master
9999999-dev
Tactician command bus middleware for rate limiting command execution
Sources
Download
MIT
The Requires
The Development Requires
by
Pavel Agaletskiy
0.1.0
0.1.0.0
Tactician command bus middleware for rate limiting command execution
Sources
Download
MIT
The Requires
The Development Requires
by
Pavel Agaletskiy