def __init__(self, threads_num, max_tasks=0, collect_results=False):
        """ create a pool of workers, run tasks, collect results
        :param threads_num: number of workers
        :param max_tasks: limit the tasks queue
        :param collect_results: you can collect results from your workers

        :type threads_num: int
        :type max_tasks: int
        :type collect_results: bool
        """

        self.tasks = Queue(max_tasks)
        self.collect_results = collect_results
        self.results = []
        self.threads = []
        for _ in range(threads_num):
            self.threads.append(ThreadWorker(self))
def __init__ ( self , threads_num , max_tasks = 0 , collect_results = False ) : self . tasks = Queue ( max_tasks ) self . collect_results = collect_results self . results = [ ] self . threads = [ ] for _ in range ( threads_num ) : self . threads . append ( ThreadWorker ( self ) )
create a pool of workers, run tasks, collect results
        :param threads_num: number of workers
        :param max_tasks: limit the tasks queue
        :param collect_results: you can collect results from your workers

        :type threads_num: int
        :type max_tasks: int
        :type collect_results: bool