Metadata-Version: 2.1
Name: Flask-TaskX
Version: 1.0
Summary: A Flask extension for defining and running tasks
Home-page: https://github.com/carrasquel/flask-taskx
Author: Nelson Carrasquel
Author-email: carrasquel@outlook.com
Maintainer: Nelson Carrasquel
Maintainer-email: carrasquel@outlook.com
License: BSD
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
Requires-Dist: Flask
Requires-Dist: apscheduler
Requires-Dist: peewee
Requires-Dist: Click ==7.0

# flask-taskx
Flask-TaskX is an extension for [Flask](https://flask.palletsprojects.com/) 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.

```python
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](http://flask-taskx.readthedocs.io/en/latest/)

