log_printer.py 文件源码

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

项目:universe 作者: openai 项目源码 文件源码
def consume_queue(queue, cascade_stop):
    """Consume the queue by reading lines off of it and yielding them."""
    while True:
        try:
            item = queue.get(timeout=0.1)
        except Empty:
            yield None
            continue
        # See https://github.com/docker/compose/issues/189
        except thread.error:
            raise ShutdownException()

        if item.exc:
            raise item.exc

        if item.is_stop:
            if cascade_stop:
                raise StopIteration
            else:
                continue

        yield item.item
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号