def process_tasks(task_queue_todo, tasks_queue_complete):
    """ process a task from queue, word counts, return True """
    while not task_queue_todo.empty():
        book = task_queue_todo.get()
        get_word_counts(book)
        tasks_queue_complete.put(book)
    return True
Пример #2
0
def process_tasks(task_queue):
    proc = os.getpid()
    logger = create_logger(proc)
    while not task_queue.empty():
        try:
            book = task_queue.get()
            get_word_counts(book)
        except Exception as e:
            logger.error(e)
        logger.info(f'Process {proc} completed successfully')
    return True
def processes_task(task_queue):
    proc = os.getegid()
    logger = create_logger(proc)
    while not task_queue.empty():
        try:
            book = task_queue.get()
            get_word_counts(book)
        except Exception as e:
            logger.error(e)
            logger.info(f'PROCESSO :: {proc} COMPLETADO COM SUCESSO')
    return True
Пример #4
0
def process_tasks(task_queue):
    """ Execute tasks in task queue """
    logger = multiprocessing.get_logger()
    proc = os.getpid()
    while not task_queue.empty():
        try:
            food = task_queue.get()
            get_word_counts(food)
        except Exception as e:
            logger.error(e)
        logger.info(f'Process {proc} completed successfully')
    return True
def process_tasks(task_queue_todo, tasks_queue_complete):
    """ process a task from queue, word counts, return True """
    logger = create_logger()
    proc = os.getpid()
    while not task_queue_todo.empty():
        try:
            book = task_queue_todo.get()
            get_word_counts(book)
            tasks_queue_complete.put(book)
        except Exception as e:
            logger.error(e)
        logger.info(f'Process {proc} completed successfully')
    return True
def processes_task(task_queue):
    while not task_queue.empty():
        book = task_queue.get()
        get_word_counts(book)
    return True