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.2.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.2-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flask_rq-0.3.2.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.2.tar.gz
Algorithm Hash digest
SHA256 5c28e2f7a8299ee789016ebd826beab05097cda4536928cb6c94974311f5fcd6
MD5 4cb387e632d89683f9adf215f59aa69a
BLAKE2b-256 11531f96c26dcf3ccd1053d4c3cff447d977ba636102033762046b7b969c2bc5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: flask_rq-0.3.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f3d580c1522351730f1c2dc41b0a4088991115b51922bc20b669fce02d0bdbca
MD5 e9ae190b544ef7cdc89610cdda57adf0
BLAKE2b-256 125e7226f04150731be6d8c76361297303aa907951b5d6d202c923eb80ed4e39

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_rq-0.3.2-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