Asynchronous Task Queues

threadless_router allows inbound messages to be easily passed off to an asynchronous task queue, such as Celery. Task queues allow message processing to be handled outside of the HTTP request/response cycle.


A celery handler is bundled for example.

  • Install djcelery with pip:

    pip install django-celery==2.2.4
  • Add djcelery and threadless_router.celery apps to INSTALLED_APPS:

        # ...
        # ...
  • Point backend handler(s) to celery task:

        # ...
        "simple-http": {
            "ENGINE": '...'.
            "HANDLER": "threadless_router.celery.handler", # <-----
            "outgoing_url": '...',
        # ...
  • Start celeryd in separate shell:

    $ ./ celeryd
  • Now all inbound messages to the “simple-http” backend will respond out-of-band via a celery task.

Project Versions

Table Of Contents

Previous topic

Using rapidsms-threadless-router with Kannel

Next topic


This Page