I'm a bit skeptical whether we want to try and tea...
# squarelibraries
j
I'm a bit skeptical whether we want to try and tease out a supertype from websocket that deals with read-only streams
k
gotcha. What is the reason for the skepticism? I'm curious
j
For one, I'm not sure you'd ever need the actual polymorphism where you can write code that doesn't need to know whether its source was a WS or SSE.
k
Oh right
j
But beyond that, the OkHttp API of WS doesn't really make it easy to pull out an interface. Each callback takes a WebSocket as the first argument but in SSE you don't really need something to model the WebSocket itself, you only need the listener.
k
I guess I took what you said to mean that websockets and sse would be implemented completely separately, which seems fine
oh gotcha
does it seem like sse would be easier to pull into retrofit?
j
It may be easier, but it requires a dependency on okhttp-sse which is a bit weird. So it would fail at runtime if you were missing that. Maybe I can get SSE moved into the main artifact like WS.
It's fairly small. The problem is very few people seem to use it.
k
gotcha
yeah it definitely seems like an underutilized feature to me
sse that is
j
both SSE and WS are pretty poor protocols, their benefit is that they're available in browsers unlike something that's superior on a technical level like gRPC
k
I've never heard of grpc. I'll have to take a look
j
much more heavyweight of a tool, but equally more powerful
k
I wouldn't be able to use it unfortunately because of lack of browser availability though 😕
j
i think they host a WS-based fallback for browsers