crexi-dev / rate-limiter

A test task to implement a rate limiter pattern
8 stars 193 forks source link

Implementation of simple rate-limiter lib #188

Closed Ensiferum closed 5 months ago

Ensiferum commented 5 months ago

Implemented simple RateLimiter with some example rules (FixedWindowLimiterRule, SingleRequestPerWindowLimiterRule, RegionBasedCustomLimiterRule)

  • a certain timespan passed since the last call;

this thing could be implemented through FixedWindowLimiterRule with limit:1, but decided to add separate rule