put commands into a queue at first, then start workers numbers threads to execute this commands
(self, cmds, workers=10)
| 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): |