-
Notifications
You must be signed in to change notification settings - Fork 653
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
Migrating to Apollo 3: Usage of SubscriptionManager.start/stop
#6153
Comments
Hi! You are right that That is probably the simplest way to do that, but if that's impractical there may be a way to use val reconnectSignalChannel = Channel<Unit>(0)
object MyDisconnectException : Exception
val apolloClient = ApolloClient.Builder()
.(...)
.webSocketReopenWhen { throwable, attempt ->
if (throwable is MyDisconnectException) {
reconnectSignalChannel.receive() // suspends until calling reconnectSignalChannel.offer(Unit)
}
true
}
.build() |
Thanks for this migration path - I'm currently migrating a bunch of old Apollo2 code, I imagine this would break a lot of the wrapper logic we have. Wrote a ticket to investigate. Appreciate you! If you don't mind, can you keep this issue open for a minute so I can try and implement your suggestions? |
Hey @mformetal, anything we can do in this issue, or is it ok to close it? |
Sorry for the late reply, tons of things on my plate - going to start work on this migration this week, mind keeping it open if I have any questions? Promise it'll be closed by Friday! UPDATE: Apologies for the delay but I've been sick the past few days, haven't been able to make progress on this - I'll look into completing this on our side in the next few days. |
While migrating from Apollo 2 to Apollo 3, I can't find a trivial replacement for usage of
ApolloClient::enableSubscriptions/disableSubscriptions
. These APIs called down toSubscriptionManager.start/stop
-disable*
seems to have a corollary in:This seems to close the underlying
Channel
- would I have to recreate thesubscriptionNetworkTransport
as a corollary forenable*
?Any clues/suggestions ? 🙏 Would be much appreciated!
The text was updated successfully, but these errors were encountered: