Skip to main content

Adds Dramatiq support to your Flask application

Project description

// Flask-Dramatiq //

Flask-Dramatiq plugs Dramatiq in your Flask application.

Features

  • Configure Dramatiq from Flask configuration.
  • Ensure Flask app is available to Dramatiq actor.
  • Add worker command to Flask CLI.
  • Enable Flask Application factory.

Installation and Usage

Flask-Dramatiq is licensed under BSD-3-Clause. Add flask-dramatiq to your project:

$ poetry add flask-dramatiq

Then use Dramatiq object as a regular Flask extension:

from flask import Flask
from flask_dramatiq import Dramatiq

app = Flask(__name__)
dramatiq = Dramatiq(app)

@dramatiq.actor()
def my_actor():
    ...

@app.route("/")
def myhandler():
    my_actor.send()

Now run worker program to consume messages and execute tasks in the background:

$ flask worker --processes=1

A complete flask app is available in project source tree example.py.

Credit and Support

Feel free to open an issue or suggest a merge request on Gitlab project page. Contribution welcome!

The project is based on Bogdanp/flask_dramatiq_example.

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-dramatiq-0.2.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flask_dramatiq-0.2.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file flask-dramatiq-0.2.0.tar.gz.

File metadata

  • Download URL: flask-dramatiq-0.2.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.10 CPython/3.6.7 Linux/4.19.0-2-amd64

File hashes

Hashes for flask-dramatiq-0.2.0.tar.gz
Algorithm Hash digest
SHA256 46d5b03980f9be23b12708495b986e0184acfeb359618a8b8c9ab7641c304c52
MD5 2e4faf4a85984be5949a32a5a57d6b86
BLAKE2b-256 f6e9d063a45ffa955214e2e9ea7b797cbac9411ebedb1231b19ba1ca5ad8ea02

See more details on using hashes here.

File details

Details for the file flask_dramatiq-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: flask_dramatiq-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.10 CPython/3.6.7 Linux/4.19.0-2-amd64

File hashes

Hashes for flask_dramatiq-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 35ab597b401b2d1c4eb554746592d05a79cacf208e486e27f5f7c01505bf9fbe
MD5 df638ad7af7eb0c268317fca175b52fb
BLAKE2b-256 fe10e4b52f519e651869163a8cb791d34e7ead808632bf7c8e7327540f7d6f7a

See more details on using hashes here.

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