Skip to content

Unbreakable flask_gevent subscription resolving #48

Closed
@fallguard

Description

@fallguard
  • GraphQL AioWS version: Flask==1.1.2 Flask-Sockets==0.2.1 graphene==2.1.8 graphql-ws==0.3.1
  • Python version: 3.7.3
  • Operating System: Windows x64

Description

I checked the flask_gevent example and finded out the resolve stream does not ended when client is disconnected.

I mean the lambda inside of this

    def resolve_random_int(root, info):
        return Observable.interval(1000).map(lambda i: RandomType(seconds=i, random_int=random.randint(0, 500)))

continues be called every 1000 ms after a client breaks ws connection.

Is there way to break resolving somehow? I want to a client be subscribed all time and got a new portion of data time by time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions