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
flask-taskx-1.0.tar.gz
(2.4 kB
view hashes)
Built Distributions
Close
Hashes for flask_taskx-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acdc9fbf8a7394ef27a112312e3e044a978ffe6e415a887198d576d075335bab |
|
MD5 | a8c8460c78e8ae9d6cb4103830261d81 |
|
BLAKE2b-256 | 8258fb8f1ef88912d76071c8a464e87c844668c16742e38820d6c3da4899a22a |
Close
Hashes for Flask_TaskX-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd3d9c45029a6a2b2e33106c1fcfc539ecb1237a287f3dbf24f69238c9338bc9 |
|
MD5 | a1b02bdf99fd9640e0d7466150bd26cb |
|
BLAKE2b-256 | a894f88ae2eef07782797921ed1c40709be7bb45a38745ea2322fb5bd802d08d |