Changeset 79
- Timestamp:
- 08/18/07 01:14:34 (1 year ago)
- Files:
-
- projects/AsynCluster/trunk/asyncluster/master/control.py (modified) (3 diffs)
- projects/AsynCluster/trunk/asyncluster/master/jobs.py (deleted)
- projects/AsynCluster/trunk/asyncluster/master/test/mock.py (modified) (1 diff)
- projects/AsynCluster/trunk/asyncluster/master/test/test_jobs.py (deleted)
- projects/AsynQueue/trunk/asynqueue/base.py (modified) (3 diffs)
- projects/AsynQueue/trunk/asynqueue/jobs.py (copied) (copied from projects/AsynQueue/branches/processworker/asynqueue/jobs.py)
- projects/AsynQueue/trunk/asynqueue/processworker.py (copied) (copied from projects/AsynQueue/branches/processworker/asynqueue/processworker.py)
- projects/AsynQueue/trunk/asynqueue/test/mock.py (copied) (copied from projects/AsynQueue/branches/processworker/asynqueue/test/mock.py)
- projects/AsynQueue/trunk/asynqueue/test/test_jobs.py (copied) (copied from projects/AsynQueue/branches/processworker/asynqueue/test/test_jobs.py)
- projects/AsynQueue/trunk/asynqueue/test/test_processworker.py (copied) (copied from projects/AsynQueue/branches/processworker/asynqueue/test/test_processworker.py)
- projects/AsynQueue/trunk/asynqueue/workers.py (modified) (1 diff)
- projects/AsynQueue/trunk/setup.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
projects/AsynCluster/trunk/asyncluster/master/control.py
r2 r79 27 27 from twisted.spread import pb 28 28 29 import database, jobs 29 from asynqueue import jobs 30 import database 30 31 31 32 … … 201 202 return ID 202 203 203 return self.jobber.attach Node(nodeRoot).addCallback(gotID)204 return self.jobber.attachChild(nodeRoot).addCallback(gotID) 204 205 205 206 def detachNode(self, ID): … … 209 210 """ 210 211 self.nodes.pop(ID, None) 211 d = self.jobber.detach Node(ID)212 d = self.jobber.detachChild(ID) 212 213 if hasattr(self, 'sessionManager'): 213 214 d.addCallback( projects/AsynCluster/trunk/asyncluster/master/test/mock.py
r2 r79 51 51 self.attached = {} 52 52 53 def attach Node(self, nodeRoot):53 def attachChild(self, nodeRoot): 54 54 self.counter += 1 55 55 self.attached[self.counter] = nodeRoot 56 56 return defer.succeed(self.counter) 57 57 58 def detach Node(self, ID):58 def detachChild(self, ID): 59 59 del self.attached[ID] 60 60 projects/AsynQueue/trunk/asynqueue/base.py
r55 r79 229 229 """ 230 230 return self.mgr.hire(worker) 231 232 def _getWorkerID(self, workerOrID): 233 if workerOrID in self.mgr.workers: 234 return workerOrID 235 for thisID, worker in self.mgr.workers.iteritems(): 236 if worker == workerOrID: 237 return thisID 238 raise ValueError("No such worker") 231 239 232 240 def detachWorker(self, workerOrID, reassign=False, crash=False): … … 245 253 self.mgr.assignment(task) 246 254 247 if workerOrID in self.mgr.workers: 248 ID = workerOrID 249 else: 250 for thisID, worker in self.mgr.workers.iteritems(): 251 if worker == workerOrID: 252 ID = thisID 253 break 254 if 'ID' not in locals(): 255 raise ValueError("No such worker to detach") 255 ID = self._getWorkerID(workerOrID) 256 256 if crash: 257 257 d = self.mgr.terminate(ID, crash=True) … … 261 261 d.addCallback(terminated) 262 262 return d 263 264 def qualifyWorker(self, worker, series): 265 """ 266 Adds the specified I{series} to the qualifications of the supplied 267 I{worker}. 268 """ 269 if series not in worker.iQualified: 270 worker.iQualified.append(series) 271 self.mgr.assignmentFactory.request(worker, series) 263 272 264 273 def workers(self, ID=None): projects/AsynQueue/trunk/asynqueue/workers.py
r76 r79 217 217 C{callRemote} tasks, no more than I{N} at a time, to a particular 218 218 I{remoteReference} to a referenceable at a connected PB server. 219 220 @ivar remoteCaller: The I{callRemote} method of the remoteReference. 221 219 222 """ 220 223 implements(IWorker) projects/AsynQueue/trunk/setup.py
r55 r79 30 30 31 31 ### Define setup options 32 kw = {'version':'0. 1',32 kw = {'version':'0.2', 33 33 'license':'GPL', 34 34 'platforms':'OS Independent', … … 62 62 """.split("\n")) 63 63 64 kw['long_description'] = " ""64 kw['long_description'] = " ".join(""" 65 65 Asynchronous task queueing based on the Twisted framework, with task 66 prioritization and a powerful worker/manager interface. 67 68 Worker implementations are included for running tasks via threads, separate 69 Python interpreters, and remote worker nodes. 70 """ 66 prioritization and a powerful worker/manager interface. Worker implementations 67 are included for running tasks via threads, separate Python interpreters, and 68 remote worker nodes. 69 """.split("\n")) 71 70 72 71 ### Finally, run the setup
