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.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: flask_rq-0.3.1.tar.gz
  • Upload date:
  • Size: 10.2 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.1.tar.gz
Algorithm Hash digest
SHA256 1796f1ef27f451c44da8773b747f9d4cb7602ffdbeefe579cc7e0e219357ae96
MD5 0580f467fca9c8efc0fee461a1a76bbc
BLAKE2b-256 d91363e1826fdc17d0905c1c6868d8a568aa4b8d832e1cf09d72d7db7bd45efd

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_rq-0.3.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: flask_rq-0.3.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 18c39d573e8a6ca915801888875bf9a69072ab5e6be1707a11d1027437b76056
MD5 9f83e2611742c79b13713cdd14ba3bf5
BLAKE2b-256 f0e0c2ea4db01c9cabe34eb7c1e2486dfdddfc1df412f81a2ce90dc0b72360fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_rq-0.3.1-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 Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page