Skip to main content

FastAPI Queue

Project description

FastAPI queue

How to use

  1. Instance the class Queue with redis instance and options
# 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()
  1. Add task to queue:
# mail_service.py
await queue.add_to_queue(name="TASK_NAME", data: Any = {})

How to test in testpypi

  1. Increase the version in pyproject.toml
  2. Run command
$ . ./build_and_test.sh

How to publish new version

  1. Increase the version in pyproject.toml
  2. 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

fastapi_queue_task-0.0.11.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

fastapi_queue_task-0.0.11-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

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

Hashes for fastapi_queue_task-0.0.11.tar.gz
Algorithm Hash digest
SHA256 15289b515a70309400ec04efdc4b688292e1f0e7569412c5dbc3f4f2c31d4669
MD5 e17b4487b7b483d91fe3ab576055eaa7
BLAKE2b-256 2a1df5d92b6ee0e028f28c2187dfd092fd7e01814d489db9a3602b04388b30b4

See more details on using hashes here.

File details

Details for the file fastapi_queue_task-0.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_queue_task-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 65b3a301df4a2f7249458b2db9db096ca5c2ebf7a375cae8a9d82efe9bf7170a
MD5 6fb24d0f994625096fd5d3efef06ac21
BLAKE2b-256 01af4822580dd71b18c8800713f5d4af0f5d3a361d78005021a90f2b9d70cc70

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page