You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default backend is already fully usable for direct style Scala, along with streaming (via InputStream bodies), and web sockets (using the WebSocket's blocking .send() and .receive() methods).
However, what we are missing is integration with SSE, streaming websockets (sometimes its more convenient to work this way) and high-level streaming (mapping over byte chunks or lines, for example).
That's why it might reasonable to have an Ox integration module. In fact, this is a joint Ox+sttp-client issue, as it requires changes in both. Going from the end:
for support high-level streaming operations (on the byte-chunk or line level), we could add some I/O capabilities to Ox's Source, such as two-way conversions between an InputStream and a Source[byte chunk]; between an InputStream and a Source[String] (lines); and finally writing such sources to files/reading from files. What remains to be determined here is what's a good representation of a byte chunk. A simple Array[Byte]? ByteBuffer? Pekko's BytString?
for web sockets, we could provide a fairly simple conversion between a WebSocket and a (Source[WebSocketFrame], Sink[WebSocketFrame]
finally, for SSE, I do have some code, but it might need polishing. And it would be great to include it in the integration module:
The default backend is already fully usable for direct style Scala, along with streaming (via
InputStream
bodies), and web sockets (using theWebSocket
's blocking.send()
and.receive()
methods).However, what we are missing is integration with SSE, streaming websockets (sometimes its more convenient to work this way) and high-level streaming (mapping over byte chunks or lines, for example).
That's why it might reasonable to have an Ox integration module. In fact, this is a joint Ox+sttp-client issue, as it requires changes in both. Going from the end:
Source
, such as two-way conversions between anInputStream
and aSource[byte chunk]
; between anInputStream
and aSource[String]
(lines); and finally writing such sources to files/reading from files. What remains to be determined here is what's a good representation of abyte chunk
. A simpleArray[Byte]
?ByteBuffer
? Pekko'sBytString
?WebSocket
and a(Source[WebSocketFrame], Sink[WebSocketFrame]
Example usage:
The text was updated successfully, but these errors were encountered: