本文整理汇总了Python中EDJob.EDJob.countRunning方法的典型用法代码示例。如果您正苦于以下问题:Python EDJob.countRunning方法的具体用法?Python EDJob.countRunning怎么用?Python EDJob.countRunning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EDJob.EDJob
的用法示例。
在下文中一共展示了EDJob.countRunning方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: quitEdna
# 需要导入模块: from EDJob import EDJob [as 别名]
# 或者: from EDJob.EDJob import countRunning [as 别名]
def quitEdna(self, delay=10):
"""
Try to quit properly
@param: delay for finishing jobs
"""
self.quit = True
self.DEBUG("In %s.quitEdna()" % self.get_name())
self.screen("QuitEdna: Close input pipe" % delay)
self.processingThread.join(delay)
self.screen("QuitEdna: Finish the processing (timeout = 10s)")
t0 = time.time()
remaining = EDJob.countRunning()
while (remaining > 0) and (time.time() < t0 + delay):
self.screen("%i remaining jobs" % remaining)
time.sleep(1)
remaining = EDJob.countRunning()
self.screen("QuitEdna: Close output pipe (timeout = 10s)")
self.finishingThread.join(delay)
self.screen("Quitting tango-EdnaDS")
sys.exit()