Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ ThisBuild / versionScheme := Some("early-semver")

ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("11"))

val catsV = "2.9.0"
val catsEffectV = "3.4.9"
val catsCollectionV = "0.9.6"
val catsV = "2.11.0"
val catsEffectV = "3.6.0"
val catsCollectionV = "0.9.9"

val munitV = "1.0.0-M7"
val munitCEV = "2.0.0-M3"
val munitV = "1.0.0"
val munitCEV = "2.0.0"

lazy val mules = tlCrossRootProject
.aggregate(core, caffeine, reload, noop, bench)
Expand Down Expand Up @@ -57,7 +57,7 @@ lazy val caffeine = project
.settings(
name := "mules-caffeine",
libraryDependencies ++= Seq(
"com.github.ben-manes.caffeine" % "caffeine" % "3.1.6"
"com.github.ben-manes.caffeine" % "caffeine" % "3.2.0"
)
)
.settings(testDeps)
Expand Down Expand Up @@ -95,7 +95,7 @@ lazy val testDeps = Seq(
libraryDependencies ++= Seq(
"org.typelevel" %%% "cats-effect-laws" % catsEffectV % Test,
"org.scalameta" %%% "munit" % munitV % Test,
"org.scalameta" %%% "munit-scalacheck" % munitV % Test,
"org.scalameta" %%% "munit-scalacheck" % "1.0.0-M11" % Test,
"org.typelevel" %%% "munit-cats-effect" % munitCEV % Test
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import cats.implicits._

import scala.collection.immutable.Map
import cats.effect.std.MapRef
import cats.effect.std.MapRef.fromSeqRefs
import cats.data.NonEmptySeq

import java.util.concurrent.ConcurrentHashMap
import scala.collection.mutable
Expand Down Expand Up @@ -424,11 +424,20 @@ private[mules] object PurgeableMapRef {
def purgeExpiredEntries(shards: List[Ref[F, Map[K, V]]])(now: Long) =
shards.parFlatTraverse(SingleRef.purgeExpiredEntries(_, isExpired)(now))

shards.map { s =>
PurgeableMapRef(
fromSeqRefs(s),
purgeExpiredEntries(s)
)
shards.flatMap { s =>
NonEmptySeq.fromSeq(s) match {
case Some(nonEmptyShards) =>
Concurrent[F].pure(
PurgeableMapRef(
MapRef.fromNonEmptySeqRefs(nonEmptyShards),
purgeExpiredEntries(nonEmptyShards.toList)
)
)
case None =>
Concurrent[F].raiseError(
new IllegalArgumentException("shards must be non-empty")
)
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.4")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.7.7")
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.7.7")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.18.2")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")