added a queueable agent that will only execute one job at a time
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2484 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
		
							parent
							
								
									3f69f638d3
								
							
						
					
					
						commit
						0b91f0de2f
					
				
					 2 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
					@ -51,8 +51,10 @@ class SampleController(Controller):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    jobNumber = 0
 | 
					    jobNumber = 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    agents = (('sample01', 'base.sample'),)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _getAgents(self):
 | 
					    def _getAgents(self):
 | 
				
			||||||
        return [AgentSpecification('sample01', 'base.sample')]
 | 
					        return [AgentSpecification(name, type) for name, type in self.agents]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def enterJob(self, jobType, agent):
 | 
					    def enterJob(self, jobType, agent):
 | 
				
			||||||
        self.jobNumber += 1
 | 
					        self.jobNumber += 1
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,7 +31,6 @@ from cybertools.agent.components import controllers
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class SampleController(SampleController):
 | 
					class SampleController(SampleController):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _getAgents(self):
 | 
					    agents = (('sample01', 'core.sample'),)
 | 
				
			||||||
        return [AgentSpecification('sample01', 'core.sample')]
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
controllers.register(SampleController, Master, name='core.sample')
 | 
					controllers.register(SampleController, Master, name='core.sample')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue