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-1.0.0.tar.gz
.
File metadata
- Download URL: fastapi_queue_task-1.0.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41745d001012f23dc8dbc1a256261f2111b4a275d7875f52badfe2aa1f4b09f8 |
|
MD5 | ca39a3c87816f3b3e15c4feef103d247 |
|
BLAKE2b-256 | 126c3a4a8a7662663ba421608af3d70062039d692106405041e574ff9e873710 |
File details
Details for the file fastapi_queue_task-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: fastapi_queue_task-1.0.0-py3-none-any.whl
- Upload date:
- Size: 7.6 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 | 2ecad808bed53cf78a130414801052b8d1c96521b37f956c12c68023bdc0775f |
|
MD5 | c137a55ac184eaf17624fdfd1704414d |
|
BLAKE2b-256 | c4154b81365240a0f7d5b2ac60dc3ae4773196386cce31184f097f24f33bbb2b |