eval_is implemented using
evalwhich uses internal private types FromC and Algebra. I thought the intent would be to implement them more from the library users point of view.
evalas a primitive
evaland the other things you have learned so far?
eval_from scratch :)
Hi everyone, so I have a
Stream[F, Byte] and I'd like to create a stream that emits
128kbps. I'd like to keep the type
Stream[F, Byte]. To do this I figured I could make each
128kb and have each
Chunk process every second.
Something like this:
val perSecond = scheduler.awakeEvery(500 millis) val stream: Stream[F, Byte] = inputStream .chunks .zip(perSecond) .map(_._1) .flatMap(Stream.chunk(_).covary[F]) .repeat
This works nicely (if there is a better way than this please let me know, I am an fs2 noob). The issue I'm having right now is making each
Chunk the proper size. I want each chunk to contain
Bytes, however when I read in my
InputStream it comes in at ~8000 bytes per chunk. Is there a way I can condense these chunks so that they're all roughly 16k bytes? I've looked through the Stream code and I see a lot of things about limiting chunk size, but that's just not what I want. Is this a completely dumb way of getting the result I want? Any help is appreciated. Thanks
takeis in terms of