commit e29646a94714d516d52272fc83d9a15bbc21e488 Author: Jan Dittberner Date: Sat Dec 27 13:52:45 2014 +0100 initial version diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3bb2efd --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.*.swp +*.pyc diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/celeryrouters.py b/celeryrouters.py new file mode 100644 index 0000000..e468813 --- /dev/null +++ b/celeryrouters.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + + +class LdapRouter(object): + + def route_for_task(self, task, args=None, kwargs=None): + if 'ldap' in task: + return {'exchange': 'ldap', + 'exchange_type': 'direct', + 'queue': 'ldap'} + return None + + +class FileRouter(object): + + def route_for_task(self, task, args=None, kwargs=None): + if 'file' in task: + return {'exchange': 'file', + 'exchange_type': 'direct', + 'queue': 'file'} + return None + +