Metadata-Version: 2.1
Name: aiofreqlimit
Version: 0.0.5
Summary: Frequency limit for asyncio
Home-page: https://github.com/gleb-chipiga/aiofreqlimit
Author: Gleb Chipiga
License: MIT
Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: License :: OSI Approved :: MIT License
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Operating System :: POSIX
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Topic :: Internet
Classifier: Framework :: AsyncIO
Requires-Python: >=3.8
Description-Content-Type: text/x-rst
License-File: LICENSE

About
=====
Frequency limit context manager for asyncio.

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

.. code-block:: bash

    pip install aiofreqlimit

Using aiofreqlimit
==================
Pass a value of any hashable type to `acquire` or do not specify any parameter:

.. code-block:: python

    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())

