示例#1
0
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
0
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
0
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'