Skip to content

Commit

Permalink
Cross Scala Versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherDavenport committed Jan 5, 2022
1 parent 46fe0a0 commit aced191
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ object RedisCommands {
// TODO Scan
// TODO LEX

sealed trait Trimming
sealed trait Trimming
object Trimming {
case object Approximate extends Trimming
case object Exact extends Trimming
Expand Down Expand Up @@ -255,7 +255,7 @@ object RedisCommands {
case class From(stream: String, offset: String) extends StreamOffset
}

case class StreamsRecord(
final case class StreamsRecord(
recordId: String,
keyValues: List[(String, String)]
)
Expand All @@ -278,7 +278,7 @@ object RedisCommands {
}
}

case class XReadResponse(
final case class XReadResponse(
stream: String,
records: List[StreamsRecord]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ trait RedisStream[F[_]] {
def read(
keys: Set[String],
chunkSize: Int,
initialOffset: String => StreamOffset = StreamOffset.All,
initialOffset: String => StreamOffset = {(s: String) => StreamOffset.All(s)},
block: Duration = Duration.Zero,
count: Option[Long] = None
): Stream[F, RedisCommands.XReadResponse]
Expand Down
4 changes: 2 additions & 2 deletions examples/src/main/scala/StreamsExample.scala
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ object StreamProducerExample extends IOApp {
val consumer = rs
.read(Set(mystream), 10000)
.evalMap(putStrLn)
.onError(err => Stream.exec(IO.println(s"Consumer err: $err")))
.onError{ case err => Stream.exec(IO.println(s"Consumer err: $err"))}
.logAverageRate(rate => IO.println(s"Consumer rate: $rate/s"))

val producer =
Expand All @@ -66,7 +66,7 @@ object StreamProducerExample extends IOApp {
.flatMap{ chunk =>
Stream.evalSeq(rs.append(chunk.toList))
}
.onError(err => Stream.exec(IO.println(s"Producer err: $err")))
.onError{ case err => Stream.exec(IO.println(s"Producer err: $err"))}
.logAverageRate(rate => IO.println(s"Producer rate: $rate/s"))

val stream =
Expand Down

0 comments on commit aced191

Please sign in to comment.