transmission.py 文件源码

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

项目:libhoney-py 作者: honeycombio 项目源码 文件源码
def __init__(self, max_concurrent_batches=10, block_on_send=False,
                 block_on_response=False):
        self.max_concurrent_batches = max_concurrent_batches
        self.block_on_send = block_on_send
        self.block_on_response = block_on_response

        session = requests.Session()
        session.headers.update({"User-Agent": "libhoney-py/"+VERSION})
        self.session = session

        # libhoney adds events to the pending queue for us to send
        self.pending = queue.Queue(maxsize=1000)
        # we hand back responses from the API on the responses queue
        self.responses = queue.Queue(maxsize=2000)

        self.threads = []
        for i in range(self.max_concurrent_batches):
            t = threading.Thread(target=self._sender)
            t.daemon = True
            t.start()
            self.threads.append(t)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号