FastAPI Queue
Project description
FastAPI queue
How to use
- Instance the class
Queue
withredis
instance andoptions
# queue_config.py
from fastapi_queue_task import Queue
from redis.asyncio.utils import from_url
redis = from_url(
f"redis://#REDIS_HOST:#REDIS_PORT/#REDIS_DATABASE_NAME",
encoding="utf-8",
decode_responses=True,
)
queue = Queue(redis, options={'concurrency': 10, 'max_attempt': 3})
queue.run()
- Add task to queue:
# mail_service.py
await queue.add_to_queue(name="TASK_NAME", data: Any = {})
How to test in testpypi
- Increase the version in
pyproject.toml
- Run command
$ . ./build_and_test.sh
How to publish new version
- Increase the version in
pyproject.toml
- Run command
$ . ./build_and_publish.sh
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file fastapi_queue_task-0.0.11.tar.gz
.
File metadata
- Download URL: fastapi_queue_task-0.0.11.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15289b515a70309400ec04efdc4b688292e1f0e7569412c5dbc3f4f2c31d4669 |
|
MD5 | e17b4487b7b483d91fe3ab576055eaa7 |
|
BLAKE2b-256 | 2a1df5d92b6ee0e028f28c2187dfd092fd7e01814d489db9a3602b04388b30b4 |
File details
Details for the file fastapi_queue_task-0.0.11-py3-none-any.whl
.
File metadata
- Download URL: fastapi_queue_task-0.0.11-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65b3a301df4a2f7249458b2db9db096ca5c2ebf7a375cae8a9d82efe9bf7170a |
|
MD5 | 6fb24d0f994625096fd5d3efef06ac21 |
|
BLAKE2b-256 | 01af4822580dd71b18c8800713f5d4af0f5d3a361d78005021a90f2b9d70cc70 |