本文整理汇总了Python中Worker.Worker.check_status方法的典型用法代码示例。如果您正苦于以下问题:Python Worker.check_status方法的具体用法?Python Worker.check_status怎么用?Python Worker.check_status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Worker.Worker
的用法示例。
在下文中一共展示了Worker.check_status方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testRAT_nolimitation
# 需要导入模块: from Worker import Worker [as 别名]
# 或者: from Worker.Worker import check_status [as 别名]
def testRAT_nolimitation(self):
my_profile = ResourceLimitation(0, 0, 0)
my_worker = Worker(my_profile, self.tasks)
# -----
while True:
if my_worker.pre_process():
string2debug = my_worker.check_status()
print "\t", string2debug
my_worker.process()
my_worker.post_process()
else:
string2debug = my_worker.check_status()
print "\t", string2debug
break
self.assertEqual(string2debug,
('9', '27', '',
"[('A', 6), ('C', 6), ('B', 8), ('D', 8), ('E', 9)]"))
示例2: testRAT_max_concurrent_1
# 需要导入模块: from Worker import Worker [as 别名]
# 或者: from Worker.Worker import check_status [as 别名]
def testRAT_max_concurrent_1(self):
my_profile = ResourceLimitation(1, 0, 0)
my_worker = Worker(my_profile, self.tasks)
string2debug = my_worker.check_status()
self.assertEqual(string2debug, ('0', '0', '', '[]'))
# -----
while True:
if my_worker.pre_process():
my_worker.process()
my_worker.post_process()
else:
break
string2debug = my_worker.check_status()
print string2debug
self.assertEqual(string2debug,
('37', '9', '',
"[('A', 6), ('B', 14), ('C', 20), "
"('D', 28), ('E', 37)]"))
示例3: testRAT_max_concurrent_4
# 需要导入模块: from Worker import Worker [as 别名]
# 或者: from Worker.Worker import check_status [as 别名]
def testRAT_max_concurrent_4(self):
my_profile = ResourceLimitation(4, 0, 0)
my_worker = Worker(my_profile, self.tasks)
# -----
while True:
if my_worker.pre_process():
my_worker.process()
my_worker.post_process()
else:
break
string2debug = my_worker.check_status()
print string2debug
self.assertEqual(string2debug,
('15', '22', '',
"[('A', 6), ('C', 6), ('B', 8), "
"('D', 8), ('E', 15)]"))