(self, workers=10)
| 194 | jobstatus.duration = delta.total_seconds() |
| 195 | |
| 196 | def waitForComplete(self, workers=10): |
| 197 | self.inqueue.join() |
| 198 | lock = threading.Lock() |
| 199 | resultQueue = queue.Queue() |
| 200 | '''intermediate result is stored in self.outqueue''' |
| 201 | for i in range(workers): |
| 202 | worker = workThread(self.outqueue, resultQueue, self.apiClient, |
| 203 | self.db, lock) |
| 204 | worker.start() |
| 205 | |
| 206 | self.outqueue.join() |
| 207 | |
| 208 | asyncJobResult = [] |
| 209 | while resultQueue.qsize() > 0: |
| 210 | jobstatus = resultQueue.get() |
| 211 | self.updateTimeStamp(jobstatus) |
| 212 | asyncJobResult.append(jobstatus) |
| 213 | |
| 214 | return asyncJobResult |
| 215 | |
| 216 | def submitCmdsAndWait(self, cmds, workers=10): |
| 217 | ''' |
no test coverage detected