bus.py 文件源码

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

项目:xivo-ctid-ng 作者: wazo-pbx 项目源码 文件源码
def _drain_events(self, on_event):
        if not hasattr(self, 'bus_queue'):
            raise Exception('You must listen for events before consuming them')
        with Connection(self._url) as conn:
            with Consumer(conn, self.bus_queue, callbacks=[on_event]):
                try:
                    while True:
                        conn.drain_events(timeout=0.5)
                except TimeoutError:
                    pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号