本文整理汇总了Python中ThreadQueue.ThreadQueue.do_work方法的典型用法代码示例。如果您正苦于以下问题:Python ThreadQueue.do_work方法的具体用法?Python ThreadQueue.do_work怎么用?Python ThreadQueue.do_work使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThreadQueue.ThreadQueue
的用法示例。
在下文中一共展示了ThreadQueue.do_work方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: doThreadQueue
# 需要导入模块: from ThreadQueue import ThreadQueue [as 别名]
# 或者: from ThreadQueue.ThreadQueue import do_work [as 别名]
def doThreadQueue():
from ThreadQueue import ThreadQueue
dqc = doQueueClass()
tq = ThreadQueue(work_function=create_task_url, thread_work_function=dqc.work)
while True:
if tq.do_work():
if dqc.dowork():
break
else:
continue
print 'end'
示例2: testThreadQueue
# 需要导入模块: from ThreadQueue import ThreadQueue [as 别名]
# 或者: from ThreadQueue.ThreadQueue import do_work [as 别名]
def testThreadQueue():
from ThreadQueue import ThreadQueue
t_dict = {'a': '12', "b": '34'}
t_dict = ('1', '2')
tc = testClass(t_dict)
tq = ThreadQueue(work_function=create_task, thread_work_function=tc.test)
while True:
if tq.do_work():
continue
else:
break
print 'ok'
示例3: doThreadQueueNew
# 需要导入模块: from ThreadQueue import ThreadQueue [as 别名]
# 或者: from ThreadQueue.ThreadQueue import do_work [as 别名]
def doThreadQueueNew(max_num):
from ThreadQueue import ThreadQueue
dqc = doQueueClass()
tq = ThreadQueue(work_function=create_iter, thread_work_function=dqc.newwork, max_exec_num=max_num)
while True:
if tq.do_work():
if dqc.dowork():
break
else:
continue
else:
break
print 'end'