tx.py 文件源码

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

项目:deb-python-txaio 作者: openstack 项目源码 文件源码
def with_config(loop=None):
    global config
    if loop is not None:
        if config.loop is not None and config.loop is not loop:
            raise RuntimeError(
                "Twisted has only a single, global reactor. You passed in "
                "a reactor different from the one already configured "
                "in txaio.config.loop"
            )
    return _TxApi(config)


# NOTE: beware that twisted.logger._logger.Logger copies itself via an
# overriden __get__ method when used as recommended as a class
# descriptor.  So, we override __get__ to just return ``self`` which
# means ``log_source`` will be wrong, but we don't document that as a
# key that you can depend on anyway :/
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号