Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Asynchronous message dispatcher for concurrent tasks processing

Project Description

Loafer is an asynchronous message dispatcher for concurrent tasks processing.

Currently, only AWS SQS is supported


  • Encourages decoupling from message providers and consumers
  • Easy to extend and customize
  • Easy error handling, including integration with sentry
  • Easy to create one or multiple services
  • Generic Handlers
  • Amazon SQS integration

It requires Python 3.5+ and is very experimental at the moment, expect a lot of changes until the first major version.


A simple message forwader, from source-queue to destination-queue:

from import SQSHandler
from import SQSRoute
from loafer.managers import LoaferManager

routes = [
    SQSRoute('source-queue', handler=SQSHandler('destination-queue'),

if __name__ == '__main__':
    manager = LoaferManager(routes)


Check out the latest Loafer documentation at Read the Docs website.


1.3.1 (2017-10-22)

  • Improve performance (#35 by @allisson)
  • Fix requirement versions resolution
  • Minor fixes and improvements

1.3.0 (2017-09-26)

  • Refactor tasks dispatching, it should improve performance
  • Refactor SQSProvider to ignore HTTP 404 errors when deleting messages
  • Minor fixes and improvements

1.2.1 (2017-09-11)

  • Bump boto3 version (by @daneoshiga)

1.2.0 (2017-08-15)

  • Enable provider parameters (boto client options)

1.1.1 (2017-06-14)

  • Bugfix: fix SNS prefix value in use for topic name wildcard (by @lamenezes)

1.1.0 (2017-05-01)

  • Added initial contracsts for class-based handlers
  • Added generic handlers: SQSHandler/SNSHander
  • Improve internal error handling
  • Improve docs

1.0.2 (2017-04-13)

  • Fix sentry error handler integration

1.0.1 (2017-04-09)

  • Add tox and execute tests for py36
  • Update aiohttp/aiobotocore versions
  • Minor fixes and enhancements

1.0.0 (2017-03-27)

  • Major code rewrite
  • Remove CLI
  • Add better support for error handlers, including sentry/raven
  • Refactor exceptions
  • Add message metadata information
  • Update message lifecycle with handler/error handler return value
  • Enable execution of one service iteration (by default, it still runs “forever”)

0.0.3 (2016-04-24)

  • Improve documentation
  • Improve package metadata and dependencies
  • Add class
  • Fix ImportError exceptions for configuration that uses loafer.utils.import_callable

0.0.2 (2016-04-18)

  • Fix build hardcoding tests dependencies

0.0.1 (2016-04-18)

  • Initial release
Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
loafer-1.3.1-py3-none-any.whl (15.6 kB) Copy SHA256 Checksum SHA256 py3 Wheel Oct 22, 2017
loafer-1.3.1.tar.gz (12.2 kB) Copy SHA256 Checksum SHA256 Source Oct 22, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting