MCPcopy Create free account
hub / github.com/apache/cloudstack / submitCmdsAndWait

Method submitCmdsAndWait

tools/marvin/marvin/asyncJobMgr.py:216–228  ·  view source on GitHub ↗

put commands into a queue at first, then start workers numbers threads to execute this commands

(self, cmds, workers=10)

Source from the content-addressed store, hash-verified

214 return asyncJobResult
215
216 def submitCmdsAndWait(self, cmds, workers=10):
217 '''
218 put commands into a queue at first, then start workers numbers
219 threads to execute this commands
220 '''
221 self.submitCmds(cmds)
222 lock = threading.Lock()
223 for i in range(workers):
224 worker = workThread(self.inqueue, self.outqueue, self.apiClient,
225 self.db, lock)
226 worker.start()
227
228 return self.waitForComplete(workers)
229
230 def submitJobExecuteNtimes(self, job, ntimes=1, nums_threads=1,
231 interval=1):

Calls 4

submitCmdsMethod · 0.95
waitForCompleteMethod · 0.95
workThreadClass · 0.85
startMethod · 0.65