https://github.com/orfium/taskiq-aws
https://github.com/orfium/taskiq-aws
missing-codeowners
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/orfium/taskiq-aws
- Owner: Orfium
- License: apache-2.0
- Created: 2024-08-06T10:07:05.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-11T06:53:21.000Z (over 1 year ago)
- Last Synced: 2025-03-11T07:36:31.623Z (over 1 year ago)
- Topics: missing-codeowners
- Language: Python
- Size: 65.4 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# TaskIQ-AWS
taskiq-aws is a plugin for taskiq that adds a new broker based on amazonm's sqs.
# Installation
To use this project you must have installed core taskiq library:
```bash
pip install taskiq
```
This project can be installed using pip:
```bash
pip install taskiq-aws
```
# Usage
Let's see the example with the sqs broker:
```python
# broker.py
import asyncio
from taskiq_aws import SQSBroker
broker = SQSBroker(queue_url=http://localhost:4566)
@broker.task
async def best_task_ever() -> None:
"""Solve all problems in the world."""
await asyncio.sleep(5.5)
print("All problems are solved!")
async def main():
task = await best_task_ever.kiq()
print(await task.wait_result())
if __name__ == "__main__":
asyncio.run(main())
```
Launch the workers:
`taskiq worker broker:broker`
Then run the main code:
`python3 broker.py`
Brokers parameters:
* `queue_url` - url to the sqs.
* `aws_region` - aws region of the queue.
* `task_id_generator` - custom task_id genertaor.
* `result_backend` - custom result backend.