Skip to main content

RQ (Redis Queue) integration for Flask and Quart applications.

Project description

Flask-RQ

Flask-RQ is a Flask/Quart extension that background job execution using RQ. RQ allows queueing functions to be run in separate worker processes, allowing long-running jobs to run in the background without blocking the web app from returning a response quickly. Flask-RQ allows configuring RQ using Flask's config, and handles executing jobs in the application context, so other services like database connections are available.

Pallets Community Ecosystem

[!IMPORTANT]
This project is part of the Pallets Community Ecosystem. Pallets is the open source organization that maintains Flask; Pallets-Eco enables community maintenance of related projects. If you are interested in helping maintain this project, please reach out on the Pallets Discord server.

Installation

Install from PyPI:

$ pip install flask-rq

Example

from flask import Flask, g
from flask_rq import RQ

app = Flask(__name__)
rq = RQ(app)

@rq.job
def send_password_reset_job(user_id:  int) -> None:
    ...

@app.route("/auth/send-password-reset")
def send_password_reset():
    send_password_reset_job.enqueue(user_id=g.user.id)
    return "Check your email!"
$ flask rq worker

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

flask_rq-0.3.3.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

flask_rq-0.3.3-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file flask_rq-0.3.3.tar.gz.

File metadata

  • Download URL: flask_rq-0.3.3.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for flask_rq-0.3.3.tar.gz
Algorithm Hash digest
SHA256 8c08ac621f20a930a54ec335f2f59b5970202ba93cccb52210459a6f358b0d32
MD5 086532bf8c65e87dc8c4eee0b4a68633
BLAKE2b-256 5a0c04b51feb334da3120703c4a5b3a0da1a538e1eaf0480cd85cff9f2ec0b15

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_rq-0.3.3.tar.gz:

Publisher: publish.yaml on pallets-eco/flask-rq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flask_rq-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: flask_rq-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for flask_rq-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b2416c4bfff7351dd79f1e8f72203394dea3553d8d4ac88e9f2369b7ca2f4d87
MD5 702295a24832742c870c2b91ab4f6680
BLAKE2b-256 db8b12264d39d50f6e42414a68558e0872688259e35e16c50d8e80e40d264de1

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_rq-0.3.3-py3-none-any.whl:

Publisher: publish.yaml on pallets-eco/flask-rq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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