Skip to content

Commit

Permalink
Merge branch 'main' into update/framework-8.15.3
Browse files Browse the repository at this point in the history
  • Loading branch information
an-tex authored Nov 4, 2024
2 parents 9095f7d + 2df0c30 commit db757b8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
10 changes: 8 additions & 2 deletions akka-stream-utils/jvm/src/test/scala/StreamOpsSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,18 @@ class StreamOpsSpec extends ScalaTestWithActorTestKit with AnyWordSpecLike with

checkTable2[Boolean, Int, Either](input, operations)
}
"Either flattenF" in {
"Either collectRightF" in {
Source(Seq(Right(1), Left(true), Right(2)))
.flattenF
.collectRightF
.runWith(Sink.seq)
.futureValue shouldBe Seq(1, 2)
}
"Either flattenF" in {
Source(Seq(Right(Right(1)), Left(true), Right(Left(false)), Right(Right(2))))
.flattenF
.runWith(Sink.seq)
.futureValue shouldBe Seq(Right(1), Left(true), Left(false), Right(2))
}
"Either flatMapMergeF" in {
Source(Seq(Right(1), Left(true), Right(2)))
.flatMapMergeF(8, element => Source(Seq(element * 2, element * 4)))
Expand Down
8 changes: 7 additions & 1 deletion akka-stream-utils/shared/src/main/scala/StreamOps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,16 @@ object StreamOps {
case _ => Left(zero)
})

def flattenF: s.Repr[OutR] = s.collect {
def collectRightF: s.Repr[OutR] = s.collect {
case Right(value) => value
}

def flattenF[OutR2](implicit ev: OutR <:< Either[OutL, OutR2]): s.Repr[Either[OutL, OutR2]] =
s.map {
case Left(outL) => Left(outL)
case Right(outR) => ev.apply(outR)
}

def groupByF[K](maxSubstreams: Int, f: OutR => K): SubFlow[Either[OutL, OutR], Mat, s.Repr, s.Closed] = {
s.groupBy(maxSubstreams, {
case Right(value) => Some(f(value))
Expand Down
4 changes: 2 additions & 2 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,14 @@ object Dependencies {
}

object logback {
private val logback = "1.5.8"
private val logback = "1.5.12"

val core = "ch.qos.logback" % "logback-core" % logback
val classic = "ch.qos.logback" % "logback-classic" % logback
}

object elastic4s {
private val elastic4s = "8.15.2"
private val elastic4s = "8.15.3"
private val elasticsearch = "8.15.3"

val clientAkka = "nl.gn0s1s" %% "elastic4s-client-akka" % elastic4s
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.10.2
sbt.version=1.10.4
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.17.0")
addSbtPlugin("com.github.sbt" % "sbt-github-actions" % "0.24.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.7.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.0")
addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.2")
addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % "4.3.0")

Expand Down

0 comments on commit db757b8

Please sign in to comment.