detect disconnect
还没有人认领这个 Issue。
评估
调研方向
从 examples/aiohttp/schema.py 开始,并查看 issue 中展示的 subscription resolver。跟踪 aiohttp websocket 如何处理 subscription 取消或客户端断开连接,然后确定 resolver 如何观察这一生命周期。完成的标准是,有一种经过文档说明和测试的方式可以知道某个 subscriber 何时不再连接。
由索引模型根据 Issue 内容生成。
描述
- GraphQL AioWS version: 0.3.1
- Python version: 3.8.6
- Operating System: MacOS Catalina
Description
Trying to figure out how to know when someone isn't subscribed anymore.
What I Did
Ran the example which works great but unable to know when someone is disconnected..
import asyncio
import graphene
class Subscription(graphene.ObjectType):
count_seconds = graphene.Float(up_to=graphene.Int())
async def resolve_count_seconds(root, info, up_to=5):
for i in range(up_to):
print("YIELD SECOND", i)
yield i
await asyncio.sleep(1.)
yield up_to
schema = graphene.Schema(subscription=Subscription)
- 主要语言
- Python
- 星标
- 270
- 派生
- 85
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
graphql-python/graphql-ws 的其他 Issue
-
难度 5/5 一周以上 新手友好度 20/100
graphql-python/graphql-ws#95 · 1 个 reaction ·
-
graphql-ws-next 未关闭
难度 5/5 一周以上 新手友好度 20/100
graphql-python/graphql-ws#90 · 4 条评论 ·
-
难度 3/5 1-2 天 新手友好度 35/100
graphql-python/graphql-ws#89 ·
-
难度 2/5 1-3 小时 新手友好度 25/100
graphql-python/graphql-ws#87 ·
-
难度 4/5 3-5 天 新手友好度 35/100
graphql-python/graphql-ws#84 · 6 条评论 · 3 个 reaction ·
查看 graphql-python/graphql-ws 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/skills#1811 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
speaches-ai/speaches#678 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
datalayer/mcp-compose#42 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
conda-forge/spacy-feedstock#177 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
UKGovernmentBEIS/inspect_evals#2523 ·