Skip to main content

RateLimiter提供在指定时间内执行指定数量的任务功能,并且可以指定执行速度

Project description

RateLimiterX

RateLimiterX提供在指定时间内执行指定数量的任务功能,并且可以指定执行速度。另外支持以下功能:

  1. 设置执行速率:尽可能平均执行、尽可能快地执行
  2. 支持多个任务队列,每个队列可单独设置任务、速率等,例如多个代理设置不同的速率

使用说明

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

打包

  1. pip install build
  2. python -m build

发布到pypi

  1. pip install twine
  2. python -m twine upload --repository pypi dist/*
  3. 输入用户名和API Token。

Project details


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.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ratelimiterx-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file ratelimiterx-0.1.0.tar.gz.

File metadata

  • Download URL: ratelimiterx-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for ratelimiterx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5537234282af11bace325189f0cf8e99d239503165938ecedfe7bd9d6b999b03
MD5 3d86c7ae97e865118709a05684a11102
BLAKE2b-256 11874b20128d6a44a7309b712015b9ce90b59c5c104c152f865b814ed1b0a580

See more details on using hashes here.

File details

Details for the file ratelimiterx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ratelimiterx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for ratelimiterx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd2969e7d11f07ca0dad4131299b2dc6f6bb980a4a122ae45c78b2e8811348d8
MD5 fdf3edefc6a2316cf36289a1ab987009
BLAKE2b-256 50e549d49ecff97312882ef86d0549d04c98c0cacd46629591cc5956cff91ca2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page