Hi folks, I'm the one who opened this ticket: <htt...
# apollo-kotlin
f
Hi folks, I'm the one who opened this ticket: https://github.com/apollographql/apollo-kotlin/issues/3756 cc : hi @bod
👋 2
m
Hi 👋 . Quick question: would it make sense to use the
NetworkTransport
API instead of
WsProtocol
?
WebSocketNetworkTransport
main goal is to multiplex subscription over a single WebSocketConnection but I understand this multiplexing doesn't exist with SSE because each subscriptions either has: • its own TCP connection (HTTP1) • or uses multiplexing at the HTTP layer (HTTP2)
So you wouldn't have to filter by
rquestUuid
or do any of the serializing all messages in the
messages
channel
For the record, the closest to a specification of SSE I could find is this: https://www.html5rocks.com/en/tutorials/eventsource/basics/
From what I understand, it's a HTTP requests with content-type set to
text/event-stream
that sends messages delimited by an extra newline:
Copy code
data: message1

data: message2

data: message3 is a
data: multi-line message

data: message4
?
f
hey Before I knew this existed I came up with a draft that is basically the same:
<https://github.com/enisdenjo/graphql-sse>
And while you can open an SSE per subscription that's not the path we're taking, it's akin to what's described in the middle of the above doc. Btw we'll use HTTP1. And you got the bulk of SSE right. We're planning to use SSE
id:
to help with demultiplexing and finding the correct "destination" of a particular
data:
piece
m
Copy code
Having aforementioned limitations in mind, a "single connection mode" is proposed. In this mode, a single established SSE connection transmits all results from the server while separate HTTP requests dictate the behaviour.
1
Looks like this is the plan ?
If that's the case then yeah some of the
WebsocketNetworkTransport
logic for demultiplexing will be handy
Although tbh, I'd still copy/paste it and implement a different NetworkTransport
f
Hi 👋 . Quick question: would it make sense to use the 
NetworkTransport
 API instead of 
WsProtocol
 ?
I definitely need a new transport. I also went out of my way to also use WsProtocol, in the hopes of reusing something, but so far nothing good came out of it.
Working this week on the demultiplexing, will know better soon.
Just curious @mbonnin are you one of the Apollo devs? At some point I'd like to discuss patterns/strategies with somebody that will do code review. Preferrably before I finish my PoC and start writing code in
apollo-kotlin
.
m
I am one of the maintainers. @bod is too. But we welcome anyone to do code review in general. The more, the merrier!
😃 1
@Fabio if you ever want to publish on MavenCentral, this is a good summary of how to do it: https://getstream.io/blog/publishing-libraries-to-mavencentral-2021/
👍 1