Skip to main content

Frequency limit for asyncio

Project description

Latest PyPI package version License Downloads count

Installation

aiofreqlimit requires Python 3.11 or greater and is available on PyPI. Use pip to install it:

pip install aiofreqlimit

Using aiofreqlimit

Pass a value of any hashable type to acquire or do not specify any parameter:

import asyncio

from aiofreqlimit import FreqLimit

limit = FreqLimit(1 / 10)


async def job():
    async with limit.acquire('some_key'):
        await some_call()


async def main():
    await asyncio.gather(job() for _ in range(100))


asyncio.run(main())

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

aiofreqlimit-0.0.16.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

aiofreqlimit-0.0.16-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file aiofreqlimit-0.0.16.tar.gz.

File metadata

  • Download URL: aiofreqlimit-0.0.16.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for aiofreqlimit-0.0.16.tar.gz
Algorithm Hash digest
SHA256 afb206903fa08b91fb4beba0c0ad617a018f1fb56996917e9b1dfacfaf85f826
MD5 6041ba9c669a9a75f3e18ec5e400f0bb
BLAKE2b-256 b9f42a828b6dd2973745810eec7f82731c61dfda8d983d4b3e12c3dee5c11ecd

See more details on using hashes here.

File details

Details for the file aiofreqlimit-0.0.16-py3-none-any.whl.

File metadata

File hashes

Hashes for aiofreqlimit-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 7c6f1d948b9f3ca971d1d8642e5a6b6dea8f2885c532120895dbdadbe443e6a2
MD5 b349150bcdbc178fcddfa4a32298119f
BLAKE2b-256 1df6a40c273e433e8509e08fb2c83c8912a8e34fc8673a242239fd7dc68f47a7

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