Skip to main content

A library to limit async calls using a waterwheel approach to ensure calls maximize the rate limit.

Project description

aioburst

A library to limit async calls using a waterwheel approach to ensure calls maximize the rate limit. The library is extremely light, using only core python packages.

Usage

Install the package using pip:

pip install aioburst

Import the limiter:

from aioburst import limiter

The package is purely functional, so there is no class to instantiate. limiter is used as a context manager:

async with limiter(semaphore, period):
    ...

semaphore is an instance of asyncio.Semaphore instantiated with a value equal to the number of simultanous calls that are allowed. Pass the semaphore instance to limiter. period is the period over which the number of calls are evaluated in seconds. For example, if you want to make 4 calls/second, you would pass in semaphore=Semaphore(4) and period=1.

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

aioburst-0.1.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

aioburst-0.1.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file aioburst-0.1.1.tar.gz.

File metadata

  • Download URL: aioburst-0.1.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.7 Linux/5.4.0-1090-azure

File hashes

Hashes for aioburst-0.1.1.tar.gz
Algorithm Hash digest
SHA256 32c5bef8b96eaa45741148a0c62bdf59e5b17588aae8f7b66d7d0a051c348230
MD5 4c0ecdf66c6e2ca89c9b010c578c77a4
BLAKE2b-256 d45c5373ce66e9003a1207f99127ab2edfd6e76d6688291202d4572a013b98ec

See more details on using hashes here.

File details

Details for the file aioburst-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: aioburst-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.7 Linux/5.4.0-1090-azure

File hashes

Hashes for aioburst-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e736700241e1b5f2ed8ef13812c7b2e3202d0fe5c5142a7a2ea49134ddb9eac3
MD5 e2294606e73a28658f360e67a7e9638e
BLAKE2b-256 68cc45535944e3bae644f27bdb8138d624ed7640865c8a0fc544b14dc2a7579b

See more details on using hashes here.

Supported by

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