initial version
This commit is contained in:
		
						commit
						e29646a947
					
				
					 3 changed files with 26 additions and 0 deletions
				
			
		
							
								
								
									
										2
									
								
								.gitignore
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
										
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,2 @@ | |||
| .*.swp | ||||
| *.pyc | ||||
							
								
								
									
										0
									
								
								__init__.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								__init__.py
									
										
									
									
									
										Normal file
									
								
							
							
								
								
									
										24
									
								
								celeryrouters.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								celeryrouters.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -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 | ||||
| 
 | ||||
| 
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue