gvafile/celeryrouters.py

16 lines
431 B
Python
Raw Normal View History

2014-12-27 13:52:45 +01:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
class GvaRouter(object):
2014-12-27 13:52:45 +01:00
def route_for_task(self, task, args=None, kwargs=None):
for route in ['ldap', 'file', 'mysql', 'pgsql', 'web']:
if route in task:
return {
'exchange': route,
2014-12-27 13:52:45 +01:00
'exchange_type': 'direct',
'queue': route,
}
2014-12-27 13:52:45 +01:00
return None