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
To bikeshed a bit, i was just imaging something of the signature def printToStream[F[_]](json: Json, cs: Charset): Stream[F, Byte] but we could go and do something like def printPipe[F[_]](cs: Charset): Pipe[F, Json, Byte] as well.
For your use case in Feral you would be able to then do printToStream(json).through(fs2.io.writeOutputStream(channel)) or something.
Reason I suggest a different printer implementation is I think having an FS2 native implementation would be able to suspend the encoding of the json better, and just overall work better with FS2 than trying to hack around Appendable
I agree that would certainly be a feature worth having. But unfortunately it doesn't address my use case. The problem with a printToStream(json).through(fs2.io.writeOutputStream(channel)) is that instead of printing the Json directly to the output stream, it goes through an intermediate representation of Chunk[Byte] which is exactly what I'm trying to avoid :)
The text was updated successfully, but these errors were encountered:
@zarthross continuing our discussion from circe/circe#1855 (comment)
I agree that would certainly be a feature worth having. But unfortunately it doesn't address my use case. The problem with a
printToStream(json).through(fs2.io.writeOutputStream(channel))
is that instead of printing theJson
directly to the output stream, it goes through an intermediate representation ofChunk[Byte]
which is exactly what I'm trying to avoid :)The text was updated successfully, but these errors were encountered: