boinkor-net / governor

A rate-limiting library for Rust (f.k.a. ratelimit_meter)
https://github.com/boinkor-net/governor
MIT License
550 stars 43 forks source link

Separate out Check And Cell Consumption #211

Open zhixinwen opened 10 months ago

zhixinwen commented 10 months ago

This resolves https://github.com/antifuchs/governor/issues/152.

They should work with existing APIs. check_only methods are for checking part. consume methods are for "billing" part.

I only implemented the directed rate limiter. If this idea is fine with @antifuchs I can follow up with keyed rate limiter.

TheWaWaR commented 3 months ago

@antifuchs Do you have any thoughts on this? Currently this is no method measure remaining capacity separately.

zhixinwen commented 2 months ago

@antifuchs gentle ping on this