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

Incubating WebSocketNetworkTransport #5362

Closed
wants to merge 1 commit into from
Closed

Incubating WebSocketNetworkTransport #5362

wants to merge 1 commit into from

Conversation

martinbonnin
Copy link
Contributor

@martinbonnin martinbonnin commented Nov 8, 2023

Introduce a new NetworkTransport for WebSockets that rewrites most of the internal machinery:

  • Uses a callbackFlow instead of a multiple Channels of messages
  • Simplify the WsProtocol interface
  • Remove ktor as a dependency

This fixes a couple of issues:

And should make debugging easier for other ones like:

The new NetworkTransport is named WebSocketNetworkTransport, just like the current one. The only thing that changes is the package name, from com.apollographql.apollo3.network.ws to com.apollographql.apollo3.network.websocket. The current plan is to:

  1. Introduce this as a separate artifact for the next version (apollo-websocket-network-transport-incubating).
  2. Make it the default for v4. The breaking change will be:
  • the package name
  • the WsProtocol API that is wildly changed. Anyone using a custom WsProtocol will need to rewrite some code but I think this is for the greater good.

Opening as draft the time to re-read everything and add KDoc

Relates to #5648

Copy link

netlify bot commented Nov 8, 2023

Deploy Preview for apollo-android-docs canceled.

Name Link
🔨 Latest commit c2e7a71
🔍 Latest deploy log https://app.netlify.com/sites/apollo-android-docs/deploys/65df4745c22b4b00087cd5c2

@martinbonnin
Copy link
Contributor Author

Obsolete

@martinbonnin martinbonnin deleted the ws2 branch July 31, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants