本文整理汇总了Python中Job.Job.start方法的典型用法代码示例。如果您正苦于以下问题:Python Job.start方法的具体用法?Python Job.start怎么用?Python Job.start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Job.Job
的用法示例。
在下文中一共展示了Job.start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from Job import Job [as 别名]
# 或者: from Job.Job import start [as 别名]
def main(self):
print "JobStarter starting up"
while True:
rawData = self.r_server.blpop("Granted_Queue")[1]
self.runParamDict = pickle.loads(rawData)
# write the paramFile back to disk (why?)
#YAML.write(self.runParamDict, self.runParamDict['Filename'])
try:
# setup correct job class and start up job
if self.runParamDict['ClassType'] == 'Local':
print "Starting local job thread for '%s'" % self.runParamDict['Filename']
j = Job(configDict=self.runParamDict)
else:
print "Starting remote job for '%s'" % self.runParamDict['Filename']
j = RemoteJob(configDict=self.runParamDict)
j.start()
print "Job Started."
pollTime = time.time() + self.runParamDict['PollPeriod'] * 60
self.r_server.zadd("Running_Queue", rawData, pollTime)
except:
print "The following job failed:'%s'" % self.runParamDict['Filename']
print time.asctime(),
traceback.print_exc()
print
self.r_server.rpush("Result_Queue", rawData)
# since this blocks, clear after queuing up
self.runParamDict = None
示例2: add_job
# 需要导入模块: from Job import Job [as 别名]
# 或者: from Job.Job import start [as 别名]
def add_job(self, cpu_steps, mem_per_step, net_sched, usb_sched):
with PyOS.pid_mutex:
PyOS.pid += 1
job = Job(PyOS.pid, cpu_steps, mem_per_step, net_sched, usb_sched, self)
self.cpu.add_job()
self.mem.add_job()
self.jobs.append(job)
job.start()