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
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 |
8c08ac621f20a930a54ec335f2f59b5970202ba93cccb52210459a6f358b0d32
|
|
MD5 |
086532bf8c65e87dc8c4eee0b4a68633
|
|
BLAKE2b-256 |
5a0c04b51feb334da3120703c4a5b3a0da1a538e1eaf0480cd85cff9f2ec0b15
|
Provenance
The following attestation bundles were made for flask_rq-0.3.3.tar.gz
:
Publisher:
publish.yaml
on pallets-eco/flask-rq
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
flask_rq-0.3.3.tar.gz
-
Subject digest:
8c08ac621f20a930a54ec335f2f59b5970202ba93cccb52210459a6f358b0d32
- Sigstore transparency entry: 226913693
- Sigstore integration time:
-
Permalink:
pallets-eco/flask-rq@9fb7f40660f9ca4bd22eda1fdd79c3f7f028cd47
-
Branch / Tag:
refs/tags/0.3.3
- Owner: https://github.com/pallets-eco
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
publish.yaml@9fb7f40660f9ca4bd22eda1fdd79c3f7f028cd47
-
Trigger Event:
push
-
Statement type:
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
Algorithm | Hash digest | |
---|---|---|
SHA256 |
b2416c4bfff7351dd79f1e8f72203394dea3553d8d4ac88e9f2369b7ca2f4d87
|
|
MD5 |
702295a24832742c870c2b91ab4f6680
|
|
BLAKE2b-256 |
db8b12264d39d50f6e42414a68558e0872688259e35e16c50d8e80e40d264de1
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
flask_rq-0.3.3-py3-none-any.whl
-
Subject digest:
b2416c4bfff7351dd79f1e8f72203394dea3553d8d4ac88e9f2369b7ca2f4d87
- Sigstore transparency entry: 226913695
- Sigstore integration time:
-
Permalink:
pallets-eco/flask-rq@9fb7f40660f9ca4bd22eda1fdd79c3f7f028cd47
-
Branch / Tag:
refs/tags/0.3.3
- Owner: https://github.com/pallets-eco
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
publish.yaml@9fb7f40660f9ca4bd22eda1fdd79c3f7f028cd47
-
Trigger Event:
push
-
Statement type: