A Flask extension for defining and running tasks
Project description
flask-taskx
Flask-TaskX is an extension for Flask that adds the capability of running tasks within the context of your Flask applications. If you are familiar with Flask, Flask-TaskX should be easy to pick up. It provides a coherent collection of decorators and tools to define and execute asynchronous tasks.
Installation
You can install Flask-TaskX with pip:
$ pip install flask-taskx
or with easy_install:
$ easy_install flask-taskx
Quick start
With Flask-TaskX, you define the task worker by instantiating a BackgroundTaskWorker and with this instance define all tasks to be executed later in the background.
from flask import Flask
from flask_taskx import BackgroundTaskWorker
app = Flask(__name__)
task_worker = BackgroundTaskWorker(app)
@task_worker.define_task
def email_task(**kwargs):
response = send_message(**kwargs)
return response
@app.route('/email_send')
def email_send():
email_task.apply(email="test@test.com")
task_worker.start()
app.run()
Documentation
The documentation is hosted on Read the Docs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flask-taskx-1.0.tar.gz.
File metadata
- Download URL: flask-taskx-1.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74499e814296adf8c34e2dca8582a2ac397b9a57d17807caf2ed301a485e832d
|
|
| MD5 |
1fc33f71525fcec3b955ca77918f6acc
|
|
| BLAKE2b-256 |
f1aca5f63a172ab743f54f61b02f43ec8b7e8147cc8b48da0fb31082c25257f9
|
File details
Details for the file flask_taskx-1.0-py3-none-any.whl.
File metadata
- Download URL: flask_taskx-1.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
acdc9fbf8a7394ef27a112312e3e044a978ffe6e415a887198d576d075335bab
|
|
| MD5 |
a8c8460c78e8ae9d6cb4103830261d81
|
|
| BLAKE2b-256 |
8258fb8f1ef88912d76071c8a464e87c844668c16742e38820d6c3da4899a22a
|
File details
Details for the file Flask_TaskX-1.0-py3-none-any.whl.
File metadata
- Download URL: Flask_TaskX-1.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd3d9c45029a6a2b2e33106c1fcfc539ecb1237a287f3dbf24f69238c9338bc9
|
|
| MD5 |
a1b02bdf99fd9640e0d7466150bd26cb
|
|
| BLAKE2b-256 |
a894f88ae2eef07782797921ed1c40709be7bb45a38745ea2322fb5bd802d08d
|