コード例 #1
0
def getAll():
    global data

    pool = Pool(size=10)
    pool.add_tasks([(getEach, (row, )) for row in data])
    pool.run()

    temp_list = list(pool.output_queue.queue)
    temp_list.sort(key=lambda e: e['編號'])
    data = temp_list
コード例 #2
0
def getAll():
    global data

    pool = Pool(size=10)
    pool.add_tasks([ ( getEach, (i, id,))  for i, id in enumerate(id_list)])
    pool.run()

    temp_list = list(pool.output_queue.queue)
    temp_list.sort(key=lambda e: e['編號'])
    data = temp_list
コード例 #3
0
ファイル: job_manager.py プロジェクト: smjurcak/csm
    def __init__(self, num_workers, worker_name):
        threading.Thread.__init__(self, name=worker_name)

        self.pool = Pool(num_workers=num_workers, name=worker_name)

        if os.name == 'nt':
            self.in_progress_jobs = []
            self.lock = threading.RLock()
        else:
            self.in_progress_jobs = Manager().list()
            self.lock = Manager().Lock()
コード例 #4
0
def getAllCount():
    global data

    pool = Pool(size=10)
    pool.add_tasks([(getCount, (row, )) for row in data])
    pool.run()

    temp_list = list(pool.output_queue.queue)
    temp_list = [returnTemp(each) for each in temp_list]
    temp_list.sort(key=lambda e: e['編號'])
    data = temp_list
コード例 #5
0
def getAll():
    global data

    pool = Pool(size=10)
    pool.add_tasks([(getEach, (
        i,
        url,
    )) for i, url in enumerate(link_list)])
    pool.run()

    temp_list = list(pool.output_queue.queue)
    temp_list.sort(key=lambda e: e['編號'])
    data = temp_list

    print(len(list(pool.error_queue.queue)))
コード例 #6
0
def getAll():
    global data, temp_list

    pool = Pool(size=10)
    pool.add_tasks([(getEach, (
        i,
        temp,
    )) for i, temp in enumerate(temp_list[0:500])])
    pool.run()

    temp_list = list(pool.output_queue.queue)
    temp_list.sort(key=lambda e: e['編號'])
    data = temp_list

    print('Error: ', len(list(pool.error_queue.queue)))
コード例 #7
0
 def start_pool(self):
     self.logger.info("Sumo Logic vRops - Starting Thread Pool\n")
     self.pool = Pool(self.pool_size)
     self.pool_started = True
     self.logger.info("Sumo Logic vRops - Pool Size:::" + str(self.pool_size) + "\n")