Skip to content
Closed
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
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Scala Steward: Reformat with scalafmt 3.7.13
83e83a2e4f5463a7031107aa7b9ae3506345a108
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "3.7.4"
version = "3.7.13"
runner.dialect = scala213source3
12 changes: 6 additions & 6 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import sbt.*

object Dependencies {

val scalatest = "org.scalatest" %% "scalatest" % "3.2.16"
val `cats-helper` = "com.evolutiongaming" %% "cats-helper" % "3.6.0"
val smetrics = "com.evolutiongaming" %% "smetrics" % "2.0.0"
val `kind-projector` = "org.typelevel" % "kind-projector" % "0.13.2"
val betterMonadicFor = "com.olegpy" %% "better-monadic-for" % "0.3.1"
val scalatest = "org.scalatest" %% "scalatest" % "3.2.16"
val `cats-helper` = "com.evolutiongaming" %% "cats-helper" % "3.6.0"
val smetrics = "com.evolutiongaming" %% "smetrics" % "2.0.0"
val `kind-projector` = "org.typelevel" % "kind-projector" % "0.13.2"
val betterMonadicFor = "com.olegpy" %% "better-monadic-for" % "0.3.1"

object Cats {
val core = "org.typelevel" %% "cats-core" % "2.9.0"
val core = "org.typelevel" %% "cats-core" % "2.9.0"
val effect = "org.typelevel" %% "cats-effect" % "3.4.11"
}
}
29 changes: 16 additions & 13 deletions src/main/scala-2/com/evolution/scache/CacheOpsCompat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,16 @@ private[scache] object CacheOpsCompat {

/** Gets a value for specific key, or tries to load it.
*
* The difference between this method and [[com.evolution.scache.Cache#getOrUpdate1]] is that
* this one allows the loading function to fail finding the value, i.e.
* return [[scala.None]].
* The difference between this method and
* [[com.evolution.scache.Cache#getOrUpdate1]] is that this one allows the
* loading function to fail finding the value, i.e. return [[scala.None]].
*
* Also this method is meant to be used where [[cats.effect.Resource]] is
* not convenient to use, i.e. when integration with legacy code is
* required or for internal implementation. For all other cases it is
* recommended to use [[com.evolution.scache.Cache.CacheOps#getOrUpdateResourceOpt]] instead as more
* human-readable alternative.
* recommended to use
* [[com.evolution.scache.Cache.CacheOps#getOrUpdateResourceOpt]] instead
* as more human-readable alternative.
*
* @param key
* The key to return the value for.
Expand All @@ -41,9 +42,9 @@ private[scache] object CacheOpsCompat {
* cache.
*
* @return
* The same semantics applies as in [[com.evolution.scache.Cache#getOrUpdate1]], except that
* the method may return [[scala.None]] in case `value` completes to
* [[scala.None]].
* The same semantics applies as in
* [[com.evolution.scache.Cache#getOrUpdate1]], except that the method
* may return [[scala.None]] in case `value` completes to [[scala.None]].
*/
def getOrUpdateOpt1Compat[A](
key: K
Expand All @@ -63,18 +64,20 @@ private[scache] object CacheOpsCompat {

/** Gets a value for specific key, or tries to load it.
*
* The difference between this method and [[com.evolution.scache.Cache.CacheOps#getOrUpdateResource]] is that
* this one allows the loading function to fail finding the value,
* i.e. return [[scala.None]].
* The difference between this method and
* [[com.evolution.scache.Cache.CacheOps#getOrUpdateResource]] is that this
* one allows the loading function to fail finding the value, i.e. return
* [[scala.None]].
*
* @param key
* The key to return the value for.
* @param value
* The function to run to load the missing value with.
*
* @return
* The same semantics applies as in [[com.evolution.scache.Cache.CacheOps#getOrUpdateResource]], except that
* the method may return [[scala.None]] in case `value` completes to
* The same semantics applies as in
* [[com.evolution.scache.Cache.CacheOps#getOrUpdateResource]], except
* that the method may return [[scala.None]] in case `value` completes to
* [[scala.None]]. The resource will be released normally even if `None`
* is returned.
*/
Expand Down
29 changes: 16 additions & 13 deletions src/main/scala-3/com/evolution/scache/CacheOpsCompat.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@ private[scache] object CacheOpsCompat {

/** Gets a value for specific key, or tries to load it.
*
* The difference between this method and [[com.evolution.scache.Cache#getOrUpdate1]] is that
* this one allows the loading function to fail finding the value, i.e.
* return [[scala.None]].
* The difference between this method and
* [[com.evolution.scache.Cache#getOrUpdate1]] is that this one allows the
* loading function to fail finding the value, i.e. return [[scala.None]].
*
* Also this method is meant to be used where [[cats.effect.Resource]] is
* not convenient to use, i.e. when integration with legacy code is
* required or for internal implementation. For all other cases it is
* recommended to use [[com.evolution.scache.Cache.CacheOps#getOrUpdateResourceOpt]] instead as more
* human-readable alternative.
* recommended to use
* [[com.evolution.scache.Cache.CacheOps#getOrUpdateResourceOpt]] instead
* as more human-readable alternative.
*
* @param key
* The key to return the value for.
Expand All @@ -40,9 +41,9 @@ private[scache] object CacheOpsCompat {
* cache.
*
* @return
* The same semantics applies as in [[com.evolution.scache.Cache#getOrUpdate1]], except that
* the method may return [[scala.None]] in case `value` completes to
* [[scala.None]].
* The same semantics applies as in
* [[com.evolution.scache.Cache#getOrUpdate1]], except that the method
* may return [[scala.None]] in case `value` completes to [[scala.None]].
*/
def getOrUpdateOpt1Compat[A](
key: K
Expand All @@ -62,18 +63,20 @@ private[scache] object CacheOpsCompat {

/** Gets a value for specific key, or tries to load it.
*
* The difference between this method and [[com.evolution.scache.Cache.CacheOps#getOrUpdateResource]] is that
* this one allows the loading function to fail finding the value,
* i.e. return [[scala.None]].
* The difference between this method and
* [[com.evolution.scache.Cache.CacheOps#getOrUpdateResource]] is that this
* one allows the loading function to fail finding the value, i.e. return
* [[scala.None]].
*
* @param key
* The key to return the value for.
* @param value
* The function to run to load the missing value with.
*
* @return
* The same semantics applies as in [[com.evolution.scache.Cache.CacheOps#getOrUpdateResource]], except that
* the method may return [[scala.None]] in case `value` completes to
* The same semantics applies as in
* [[com.evolution.scache.Cache.CacheOps#getOrUpdateResource]], except
* that the method may return [[scala.None]] in case `value` completes to
* [[scala.None]]. The resource will be released normally even if `None`
* is returned.
*/
Expand Down
Loading