application.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:hienoi 作者: christophercrouzet 项目源码 文件源码
def _main_process(logger, downwards, upwards, process_count, configs):
    """Main process."""
    try:
        while True:
            message = _receive_message(upwards, block=True)
            if message.type == _MESSAGE_ERROR:
                logger.error("Process '%s' [%d]:\n%s" % (
                    message.process_name, message.process_id, message.message))
                return Status.FAILURE
            elif message.type == _MESSAGE_QUIT:
                break
    finally:
        for _ in _range(process_count):
            _send_message(downwards, _MESSAGE_STOP)

        downwards.close()

    return Status.SUCCESS
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号