graphql-python / graphql-python/graphql-ws

detect disconnect

オープン
#53 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
270
フォーク
85
PR マージ指標
30日以内にマージされた PR はありません

説明

* 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](https://github.com/graphql-python/graphql-ws/blob/master/examples/aiohttp/schema.py#L19) which works great but unable to know when someone is disconnected..
```python
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)
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。