Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
Pool of threads consuming tasks from a queue

src/v/i/VideoPI-HEAD/NetworkHelper.py   VideoPI(Download)
#!/usr/bin/python
# -*- coding: utf8 -*-
 
import requests
from Helper import ThreadPool
    def get(self):
        self.results = [None] * len(self.urls)
        pool = ThreadPool(5)
        for idx, url in enumerate(self.urls):
            pool.add_task(self.getOne, url, idx)