grpc_client.py 文件源码

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

项目:voltha 作者: opencord 项目源码 文件源码
def start_packet_out_stream(self):

        def packet_generator():
            while 1:
                try:
                    packet = self.packet_out_queue.get(block=True, timeout=1.0)
                except Empty:
                    if self.stopped:
                        return
                else:
                    yield packet

        def stream_packets_out():
            generator = packet_generator()
            try:
                self.local_stub.StreamPacketsOut(generator)
            except _Rendezvous, e:
                if e.code() == StatusCode.UNAVAILABLE:
                    os.system("kill -15 {}".format(os.getpid()))

        reactor.callInThread(stream_packets_out)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号