28 releases

0.10.0 Oct 31, 2024
0.9.1 Apr 15, 2024
0.9.0 Dec 15, 2023
0.7.1 Sep 28, 2023
0.1.9 Nov 9, 2015

#34 in Concurrency

Download history 78159/week @ 2024-08-06 100994/week @ 2024-08-13 106651/week @ 2024-08-20 87217/week @ 2024-08-27 106225/week @ 2024-09-03 117702/week @ 2024-09-10 105301/week @ 2024-09-17 129231/week @ 2024-09-24 122525/week @ 2024-10-01 146275/week @ 2024-10-08 135767/week @ 2024-10-15 159585/week @ 2024-10-22 148804/week @ 2024-10-29 161259/week @ 2024-11-05 144886/week @ 2024-11-12 105549/week @ 2024-11-19

591,865 downloads per month
Used in 15 crates (14 directly)

MIT/Apache

105KB
2K SLoC

ratelimit

A simple ratelimiter that can be shared between threads.

Overview

This crate provides a ratelimiter that is based around a token bucket. It can be used in cases where you need to control the rate of some actions or where you may need to use admission control.

Usage

The API documentation of this library can be found at docs.rs/ratelimit.

Features

  • Simple token bucket ratelimiter for ratelimiting and admission control
  • Thread-safe so it can be used as a global ratelimiter for multi-threaded programs
  • Allows runtime reconfiguration that can be used to alter the effective ratelimit or other aspects of its behavior

License

Licensed under either of

at your option.

Support

Create a new issue on GitHub.

Authors

A full list of contributors can be found on GitHub.

Dependencies

~1.3–6.5MB
~42K SLoC