示例#1
0
    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
示例#2
0
    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
示例#3
0
    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
示例#4
0
    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
示例#5
0
    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
示例#6
0
    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