def get_workers(self, config, worker_init): workers = [] for _ in range(config.worker_size): workers.append(self.GreenClass( crawl_page, worker_init=worker_init)) return workers
def get_workers(self, config, worker_init): workers = [] for _ in range(config.worker_size): workers.append(self.ProcessClass( target=crawl_page, kwargs={'worker_init': worker_init})) return workers
def get_workers(self, config, worker_init): workers = [] for _ in range(config.worker_size): workers.append(self.GreenClass(crawl_page, worker_init=worker_init)) return workers
def get_workers(self, config, worker_init): from threading import Thread workers = [] for _ in range(config.worker_size): workers.append( Thread(target=crawl_page, kwargs={'worker_init': worker_init})) return workers
def get_workers(self, config, worker_init): workers = [] for _ in range(config.worker_size): workers.append( self.ProcessClass(target=crawl_page, kwargs={'worker_init': worker_init})) return workers