Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/windfarer/redis-token-bucket
An python token bucket implementation on redis
https://github.com/windfarer/redis-token-bucket
Last synced: 18 days ago
JSON representation
An python token bucket implementation on redis
- Host: GitHub
- URL: https://github.com/windfarer/redis-token-bucket
- Owner: Windfarer
- License: mit
- Created: 2017-06-23T02:42:39.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-03T07:03:13.000Z (over 7 years ago)
- Last Synced: 2024-12-16T02:57:34.056Z (18 days ago)
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 3
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# redis-token-bucket
## Usage:
```python
from redis_token_bucket import TokenBucketManagertbm = TokenBucketManager(redis_url="redis://path-to-your-redis", default_rate=10)
# default_rate means how many tokens will be generated per second.ok = tbm.get_token("my_key")
# if token avaliable, return True, else return False```
## TODO
* burst rate