From 0b91f0de2fc5e1c5c380e2cd6e63307320f167c6 Mon Sep 17 00:00:00 2001 From: helmutm Date: Sat, 29 Mar 2008 18:01:13 +0000 Subject: [PATCH] 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 --- agent/base/control.py | 4 +++- agent/core/control.py | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/agent/base/control.py b/agent/base/control.py index 7889dd0..7e529f9 100644 --- a/agent/base/control.py +++ b/agent/base/control.py @@ -51,8 +51,10 @@ class SampleController(Controller): jobNumber = 0 + agents = (('sample01', 'base.sample'),) + def _getAgents(self): - return [AgentSpecification('sample01', 'base.sample')] + return [AgentSpecification(name, type) for name, type in self.agents] def enterJob(self, jobType, agent): self.jobNumber += 1 diff --git a/agent/core/control.py b/agent/core/control.py index 7078630..432d439 100644 --- a/agent/core/control.py +++ b/agent/core/control.py @@ -31,7 +31,6 @@ from cybertools.agent.components import controllers class SampleController(SampleController): - def _getAgents(self): - return [AgentSpecification('sample01', 'core.sample')] + agents = (('sample01', 'core.sample'),) controllers.register(SampleController, Master, name='core.sample')