Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open/Close web socket connection #2614

Open
gayathri-nair03 opened this issue Sep 28, 2020 · 4 comments
Open

Open/Close web socket connection #2614

gayathri-nair03 opened this issue Sep 28, 2020 · 4 comments

Comments

@gayathri-nair03
Copy link

Im using Apollo Android Client v1.0.0
I see that you have exposed enableSubscriptions() and disableSubscriptions(). These internally open/close the web socket connection.
Have you exposed any other methods (in v1.0.0) that let us open/close the web socket connection without having to worry about creating a subscription? Also, are there any such methods available in the latest version of Apollo Client (v2.3.1) ?

@martinbonnin
Copy link
Contributor

Hi 👋 , Can you detail a bit more what you mean by "open/close the web socket connection without having to worry about creating a subscription" ? Why would you need other methods than enableSubscriptions()/disableSubscriptions() ?

@gayathri-nair03
Copy link
Author

I need to open the web socket connection open on app init, not on first subscription. This is so that we can avoid the sudden spike/surge in connection requests, say when millions of users land on a certain screen altogether (worst case scenario). So we want to make web socket connection on app init itself and then subscribe later on.

@martinbonnin
Copy link
Contributor

Thanks for the explanation! I'm not aware of anything like this but I'm not super familiar with subscription code so don't take this as gospel. I'll keep looking.

@tusharmath
Copy link

Typically you would want to keep the transport separate from graphql. Web socket Connection lifecycle should be managed by the dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants