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

Method waitForComplete

tools/marvin/marvin/asyncJobMgr.py:196–214  ·  view source on GitHub ↗
(self, workers=10)

Source from the content-addressed store, hash-verified

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 '''

Callers 1

submitCmdsAndWaitMethod · 0.95

Calls 7

updateTimeStampMethod · 0.95
workThreadClass · 0.85
QueueMethod · 0.80
startMethod · 0.65
getMethod · 0.65
joinMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected