def graphql_websocket(request): return websocket_server.handle(request) Websocket server class Subscription(graphene.ObjectType): count_to = graphene.Int(max=graphene.Int()) async def resolve_count_to(root, info, max=10): for i in range(max): yield i await asyncio.sleep(1.0) # Sleep 1 sec Subscription type Thanks to async iterators in Python 3.6
in how template engines work internally. Launched PyJade 6 years ago. • Since then, I’ve been experimenting with a lot of different template engines, from Python to JS.