本文整理匯總了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'