ecthiender / py-graphql-client

Dead-simple GraphQL client with subscriptions over websockets
https://pypi.org/project/py-graphql-client/
Other
37 stars 11 forks source link

Removing sleep. The conn.recv call is blocking #11

Closed anthonyhiga closed 4 years ago

anthonyhiga commented 5 years ago

This is purely a suggestion. The time.sleep isn't really needed here since we're gonna wait on the conn.recv call anyway. If subscription messages come in faster than 1 second, the connection is gonna back up w/ requests and the server may eventually timeout on sends.

I've tested this on my own project and it speeds up subscriptions quite a bit. You can confirm this works by subscribing to something and then watching "top" to make sure your process isn't looping and chewing up CPU time.

nerdoc commented 5 years ago

Any progress on this? Is this project dead?

ecthiender commented 5 years ago

@nerdoc hey there! Admittedly I am a bit busy. I would ofcourse like to keep this project going. Please feel free to contribute.

I will take a look at this PR very soon (hopefully tonight) :)

TimGuiteDiamond commented 4 years ago

I found this myself! Is this project still being worked on? This is quite a simple change which should be merged.

ecthiender commented 4 years ago

@TimGuiteDiamond @nerdoc @anthonyhiga sorry folks for the extreme delay! I have merged this and release a new beta version.

Install via: pip install py-graphql-client==0.1.1b1

Once you confirm it all works, I will publish a stable version (0.1.1).