165 questions
0
votes
1
answer
58
views
fs2.stream concurrent: saving stream item into db depending on another stream
I have three streams s1: fs2.Stream[IO, A], s2: fs2.Stream[IO, B], and s3: fs2.Stream[IO, C].
s1, s2 have a lot of items and s3 has only one item. The items of s1 and s2 need to be saved to db, which ...
0
votes
1
answer
128
views
how to zip/merge fs2.stream values
given a list of stream like the following:
val sa = fs2.Stream(a1,a2,a3…)
val sb = fs2.Stream(b1,b2,b3…)
val sc = fs2.Stream(c1,c2,c3…)
……
val sx = fs2.Stream(x1,x2,x3…)
how to get
val re = fs2....
1
vote
0
answers
51
views
Scala: Swing GUI for FS2 client
I'm trying to realize FS2 client application with GUI on FS2 library.
Realization includes 2 steps:
User enter host and port in fields of Panel:
If request and response success, we see "data ...
0
votes
1
answer
46
views
Scala FS2 circe: No implicit found for evidence
I'm trying to realise simple server on FS2, which receives json message and
decodes it with circe-library.
My code is following:
import cats.effect.{IO, IOApp, Temporal}
import cats.effect.std.Console
...
1
vote
1
answer
155
views
Peeking at the result of a Doobie query using fs2 to materialize errors
I want to stream the result of a Doobie query as JSON using htpp4s. The core problem is that errors (like malformed query) are only occuring during stream evaluation when http4s has already sent the ...
1
vote
0
answers
99
views
FS2 who to do a onCancelWith
I have a grpc service which ofer an API looking like that def f(input: fs2.Stream[F, Input]) : fs2.Stream[F, Output]
the Input is basically formed like
sealed trait Input
case Data(x : ByteBuffer) ...
1
vote
1
answer
403
views
Scala Fs2: Aggregate computation on infinite streams
I cant seem to understand how to perform aggregate computations on infinite streams. Taking an infinite stream of elements and performing a computation on each one individually is easy, but collecting ...
1
vote
1
answer
140
views
How can I update a variable within my Http4s service every set interval of time?
I am trying to continually refresh a value after a set interval of time within an Http4s service. Up until now it's been defined as just a val that maintains its initial value. I would like to ...
1
vote
0
answers
58
views
How to combine multiple ordered streams efficiently?
Given a List[Stream[F[_], A], where A <: Ordered, and each stream contains an ordered list of elements, what is an effective way to combine these streams into a single, ordered stream of all ...
1
vote
0
answers
177
views
How to Codec Case Class using Vulcan in FS2 Kafka
I have the following case classes. Trying to produce a avro message to Kafka, using FS2 and Vulcan to do the Codec.
case class People(name: String, address: Seq[Address])
case class Address(`type`: ...
1
vote
1
answer
170
views
Handling Exceptions in Scala FS2 Stream Transformation flow
import cats.effect.{IO, IOApp}
import fs2.Pipe
import fs2.Stream
object Test extends IOApp.Simple {
final case class Student(id: Int, name: String)
private val studentData: Map[Int, Student] = ...
1
vote
1
answer
136
views
How to make cancellable timeout callback?
I want that user can run a timer with callback and able to cancel it. Something like this:
def main: F[Unit] =
for
cancel <- runTimer(callback, 5.seconds)
shouldCancel <- askUser
...
0
votes
2
answers
313
views
What are some FS2 Error Hanlding Practices?
I am new to FS2, Cats Effect, etc., but I have been using Scala since 2005 and Akka since 2010...
I tuned up the FS2 example code to play with error-handling ideas, but I wondered if there are better ...
0
votes
1
answer
415
views
fs2: How to do something once the stream is started ("doOnSubscribe")?
I am trying to use an impure ("java") API in the context of a cats-effect IO-App. The impure API looks somewhat like this:
import io.reactivex.Flowable
import java.util.concurrent....
0
votes
0
answers
178
views
Stream.Eval vs Stream.generate
I am a Scala programer. For a specific project i need to revert to pure java.
I have been meaning to learn what could be an equivalent for using fs2 in java.
I found several candidate such as reactor. ...