Esempio n. 1
0
    def convert_images(self):
        """ Convert the images """
        logger.debug("Converting images")
        save_queue = queue_manager.get_queue("convert_out")
        patch_queue = queue_manager.get_queue("patch")
        completion_queue = queue_manager.get_queue("patch_completed")
        pool = PoolProcess(self.converter.process,
                           patch_queue,
                           save_queue,
                           completion_queue=completion_queue,
                           processes=self.pool_processes)
        pool.start()
        completed_count = 0
        while True:
            self.check_thread_error()
            if self.disk_io.completion_event.is_set():
                logger.debug("DiskIO completion event set. Joining Pool")
                break
            try:
                completed = completion_queue.get(True, 1)
            except QueueEmpty:
                continue
            completed_count += completed
            logger.debug("Total process pools completed: %s of %s",
                         completed_count, pool.procs)
            if completed_count == pool.procs:
                logger.debug("All processes completed. Joining Pool")
                break
        pool.join()

        logger.debug("Putting EOF")
        save_queue.put("EOF")
        logger.debug("Converted images")
Esempio n. 2
0
    def convert_images(self):
        """ Convert the images """
        logger.debug("Converting images")
        save_queue = queue_manager.get_queue("save")
        patch_queue = queue_manager.get_queue("patch")
        pool = PoolProcess(self.converter.process, patch_queue, save_queue,
                           processes=self.pool_processes)
        pool.start()
        while True:
            self.check_thread_error()
            if self.disk_io.completion_event.is_set():
                break
            sleep(1)
        pool.join()

        save_queue.put("EOF")
        logger.debug("Converted images")
Esempio n. 3
0
    def convert_images(self):
        """ Convert the images """
        logger.debug("Converting images")
        save_queue = queue_manager.get_queue("convert_out")
        patch_queue = queue_manager.get_queue("patch")
        pool = PoolProcess(self.converter.process, patch_queue, save_queue,
                           processes=self.pool_processes)
        pool.start()
        while True:
            self.check_thread_error()
            if self.disk_io.completion_event.is_set():
                break
            sleep(1)
        pool.join()

        save_queue.put("EOF")
        logger.debug("Converted images")