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

Uploaded Python 3

File details

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

File metadata

  • Download URL: flask_rq-0.3.0.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.0.tar.gz
Algorithm Hash digest
SHA256 412fddc62883bd3f5c7b6d035171e5e5241a2602ba165c576ce9700108ec6997
MD5 47df0a9123cb9cd7de593d7cec11f621
BLAKE2b-256 b053c7abd96d8ca85404918ec4e0d6a0ddd8bf4819355e7149e6606d4e526e7d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: flask_rq-0.3.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d5070fe788aafe15abe55afaf72e1f485cb6c09e300b9b547d0bc07078768ea
MD5 3f20574a59affafdad639a2929fa3766
BLAKE2b-256 999ca73e81a5ece76057b6b3db9146958d06a4c3f091daf6fcf04863c514d547

See more details on using hashes here.

Provenance

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