Metadata-Version: 2.1
Name: callback-executor
Version: 0.0.1
Summary: A callback queue that execute each callback in a minimum period of time.
Home-page: https://github.com/wladimirguerra/callback_executor
Author: Wladimir Guerra
Author-email: wladimir.guerra.dev@gmail.com
License: UNKNOWN
Project-URL: Bug Tracker, https://github.com/wladimirguerra/callback_executor/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENCE

# Request Sender

This module provides a `CallbackExecutor` class to receive and queue callbacks to 
be executed in a defined minimum interval.


## Use Case
If one needs to limit the rate of request to an API endpoint.

### Sample Code

```
import asyncio
from callback_executor import ExecutorQueue

async main():
    exec_queue = ExecutorQueue(call_interval=0.5)
    await exec_queue.ready()
    
    tasks = [
        exec_queue.enqueue_callback(blocking_request_to_api_1),
        exec_queue.enqueue_callback(blocking_request_to_api_2),
    ]
    
    responses = await asyncio.gather(*tasks)
    
    # Handle responses

if __name__ == "__main__":
    asyncio.run(main())
```


