graphql-python / graphql-python/graphql-ws

detect disconnect

Đang mở
#53 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
270
Fork
85
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

* 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)
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.