All Projects → symfony → rate-limiter

symfony / rate-limiter

Licence: MIT license
The Rate Limiter Component provides a Token Bucket implementation to rate limit input and output in your application.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to rate-limiter

Limitrr
Light NodeJS rate limiting and response delaying using Redis - including Express middleware.
Stars: ✭ 203 (+30.13%)
Mutual labels:  rate, rate-limiter
adaptive throttler
manages multiple throttlers with ability to ramp up and down
Stars: ✭ 31 (-80.13%)
Mutual labels:  rate, rate-limiter
Laravel Likeable
Rate Eloquent models with Likes and Dislikes in Laravel. Development moved to Laravel Love package!
Stars: ✭ 95 (-39.1%)
Mutual labels:  rate
vue-cute-rate
Simple to use and very cute rate component for Vue.js.
Stars: ✭ 43 (-72.44%)
Mutual labels:  rate
AudioEffectDynamics
Dynamics Processor (Gate, Compressor & Limiter) for the Teensy Audio Library
Stars: ✭ 23 (-85.26%)
Mutual labels:  limiter
Androidrate
AndroidRate is a library to help you promote your Android app by prompting users to rate the app after using it for a few days.
Stars: ✭ 117 (-25%)
Mutual labels:  rate
nestjs-ratelimiter
Distributed consistent flexible NestJS rate limiter based on Redis
Stars: ✭ 49 (-68.59%)
Mutual labels:  rate-limiter
Starrate
swift电商五星评价,星星评分控件,支持自定义数量、拖拽、间隔、设置最小星星数等操作
Stars: ✭ 85 (-45.51%)
Mutual labels:  rate
flood-protection
Flood protection for realtime applications
Stars: ✭ 19 (-87.82%)
Mutual labels:  rate
gentle-force
Brute-force, error and request rate limiting
Stars: ✭ 45 (-71.15%)
Mutual labels:  rate-limiter
Zztools
包括: StarView星星评价(支持半星, 整星, 任意星, 支持拖动, 支持自定义星星图片, 数量, 大小, 间距, 最低分值). 瀑布流(垂直, 浮动, 混合模式瀑布流)等.
Stars: ✭ 175 (+12.18%)
Mutual labels:  rate
Node Currency Swap
Currency Exchange Rates library for nodejs
Stars: ✭ 119 (-23.72%)
Mutual labels:  rate
koa-ip-filter
koa middleware to filter request IPs or custom ID with glob patterns, array, string, regexp or matcher function. Support custom 403 Forbidden message and custom ID.
Stars: ✭ 23 (-85.26%)
Mutual labels:  limiter
Moeda
💰 📈 A foreign exchange rates and currency conversion using CLI
Stars: ✭ 113 (-27.56%)
Mutual labels:  rate
redislimiter-spring-boot
an excellent API limiting framework for Spring boot/cloud application, especially for microservice project
Stars: ✭ 64 (-58.97%)
Mutual labels:  rate-limiter
Movie Recommender System
Basic Movie Recommendation Web Application using user-item collaborative filtering.
Stars: ✭ 85 (-45.51%)
Mutual labels:  rate
Ngx Bar Rating
Angular Bar Rating
Stars: ✭ 146 (-6.41%)
Mutual labels:  rate
matchering-cli
🎚️ Simple Matchering 2.0 Command Line Application
Stars: ✭ 28 (-82.05%)
Mutual labels:  limiter
matchering-web
🎚️ Self-Hosted LANDR / eMastered Alternative
Stars: ✭ 25 (-83.97%)
Mutual labels:  limiter
polyfill-php74
This component provides functions unavailable in releases prior to PHP 7.4.
Stars: ✭ 26 (-83.33%)
Mutual labels:  symfony-component

Rate Limiter Component

The Rate Limiter component provides a Token Bucket implementation to rate limit input and output in your application.

Getting Started

$ composer require symfony/rate-limiter
use Symfony\Component\RateLimiter\Storage\InMemoryStorage;
use Symfony\Component\RateLimiter\RateLimiterFactory;

$factory = new RateLimiterFactory([
    'id' => 'login',
    'policy' => 'token_bucket',
    'limit' => 10,
    'rate' => ['interval' => '15 minutes'],
], new InMemoryStorage());

$limiter = $factory->create();

// blocks until 1 token is free to use for this process
$limiter->reserve(1)->wait();
// ... execute the code

// only claims 1 token if it's free at this moment (useful if you plan to skip this process)
if ($limiter->consume(1)->isAccepted()) {
   // ... execute the code
}

Resources

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].