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
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
Close
Hashes for fastapi_queue_task-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7a019919cfff6d1789cd82d8006ceaf21981f635ccef6c574e52da22388bc36 |
|
MD5 | dea2d1b3fcda7c5b81fed7267631d611 |
|
BLAKE2b-256 | 4d68e2dce2c5f1d74b5a0a7d517a54c3efc2ffed1436196a345e515ab8c189be |