2017 © Pedro Peláez
 

library tactician-rate-limit

Tactician command bus middleware for rate limiting command execution

image

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

The README.md

Lamoda Tactician Rate Limit Middleware

Build Status Scrutinizer Code Quality Code Coverage Build Status, (*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)

  1. Require stiphle via composer: bash composer require davedevelopment/stiphle
  2. 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)

The Versions

19/07 2018

dev-master

9999999-dev

Tactician command bus middleware for rate limiting command execution

  Sources   Download

MIT

The Requires

 

The Development Requires

by Pavel Agaletskiy

19/07 2018

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