Skip to main content

A RabbitMQ asynchronous task queue for Django.

Project description

Introduction

Carrot is a lightweight task queue backend for Django projects that uses the RabbitMQ message broker, with an emphasis on quick and easy configuration and task tracking

Features

  • Minimal configuration required

  • Task scheduling

  • Task prioritization

  • Task-level monitoring via the Carrot monitor

  • Multithreaded queue consumers

  • new in v0.2 built in django-admin daemon

Installation

pip install django-carrot

Configuration

  1. Add carrot to your Django project’s settings module:

INSTALLED_APPS = [
    ...
    'carrot',
    ...
]
  1. Create the carrot migrations and apply them to your project’s database:

python manage.py makemigrations carrot
python manage.py migrate carrot
  1. Set your default broker in your Django project’s settings

CARROT = {
    'default_broker': 'amqp://guest:guest@localhost:5672
}

Usage

To start the service:

python manage.py carrot_daemon start

To run tasks asynchronously:

from carrot.utilities import publish_message

def my_task(**kwargs):
    return 'hello world'

publish_message(my_task, hello=True)

To schedule tasks to run at a given interval

from carrot.utilities import create_scheduled_task

create_scheduled_task(my_task, {'seconds': 5}, hello=True)

Full documentation

The full documentation is available at readthedocs.io <http://django-carrot.readthedocs.io/en/latest/index.html>

Contribute

Please refer to Contributing to Carrot <https://github.com/chris104957/django-carrot/blob/master/CONTRIBUTING.md>

Support

If you are having any issues, please contact christopherdavies553@gmail.com

License

The project is licensed under the Apache license.

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

django-carrot-0.2.5.tar.gz (37.4 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page