RateLimiter提供在指定时间内执行指定数量的任务功能,并且可以指定执行速度
Project description
RateLimiterX
RateLimiterX提供在指定时间内执行指定数量的任务功能,并且可以指定执行速度。另外支持以下功能:
- 设置执行速率:尽可能平均执行、尽可能快地执行
- 支持多个任务队列,每个队列可单独设置任务、速率等,例如多个代理设置不同的速率
使用说明
from ratelimiterx.ratelimiterx import RateLimiterX, Task, Speed
def example():
rl = RateLimiterX(10 * 1000, 10)
rate_limiterx_queue_id = init_ratelimiterx.create_queue(1000, 5)
def fun1():
# do something
pass
for i in range(10):
init_ratelimiterx.add_task(rate_limiter_queue_id, Task(fun1))
init_ratelimiterx.join()
init_ratelimiterx.destroy()
项目说明
目录说明
- README.md: 包含使用手册、项目说明
执行依赖安装
pip install -r requirements.txt
依赖固化
pip freeze > requirements.txt
打包
- pip install build
- python -m build
发布到pypi
- pip install twine
- python -m twine upload --repository pypi dist/*
- 输入用户名和API Token。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ratelimiterx-0.1.1.tar.gz
(6.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ratelimiterx-0.1.1.tar.gz.
File metadata
- Download URL: ratelimiterx-0.1.1.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bf1a936f7ade8e558759db3f449f5f0f6d11ddf02657a29d56a7a70f2edf2cc
|
|
| MD5 |
56e7fed89060ef47b834c711908d0ee7
|
|
| BLAKE2b-256 |
2569e2b2ce8814147baded9852e8bf2d299110b4f6c4df0058004674ffce420b
|
File details
Details for the file ratelimiterx-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ratelimiterx-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa40fa625c9d49a0c40f4968355b9b483efbd739c4bfd0649e4279242d7f4194
|
|
| MD5 |
a81896332edea4057770d6c7122d1af1
|
|
| BLAKE2b-256 |
6197a61b7526f80cae5124f80d4af7c04ffda425061fa6722cf182b07c0d3133
|