subscription_transport_ws.py 文件源码

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

项目:graphql-python-subscriptions 作者: hballard 项目源码 文件源码
def on_open(self):
        if self.ws.protocol is None or (
                GRAPHQL_SUBSCRIPTIONS not in self.ws.protocol):
            self.ws.close(1002)

        def keep_alive_callback():
            if not self.ws.closed:
                self.send_keep_alive()
            else:
                gevent.kill(keep_alive_timer)

        if self.keep_alive:
            keep_alive_timer = gevent.spawn(self.timer, keep_alive_callback,
                                            self.keep_alive)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号