wsocket.py 文件源码

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

项目:smc-python 作者: gabstopper 项目源码 文件源码
def on_open(self):
        """
        Once the connection is made, start the query off and
        start an event loop to wait for a signal to
        stop. Results are yielded within receive().
        """
        def event_loop():
            logger.debug(pformat(self.query.request))
            self.send(json.dumps(self.query.request))
            while not self.event.is_set():
                #print('Waiting around on the socket')
                self.event.wait(self.gettimeout())

            logger.debug('Event loop terminating.')

        self.thread = threading.Thread(
            target=event_loop)
        self.thread.setDaemon(True)
        self.thread.start()
评论列表


问题


面经


文章

微信
公众号

扫码关注公众号