Skip to content

Commit

Permalink
Rename once more
Browse files Browse the repository at this point in the history
  • Loading branch information
kyri-petrou committed Jul 5, 2024
1 parent ffda828 commit 04f882b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions zio-query/shared/src/main/scala/zio/query/Cache.scala
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ object Cache {
* value. Prefer extending this class when implementing a cache that doesn't
* perform any IO, such as a cache based on a Map.
*/
abstract class InMemory extends Cache {
abstract class InMemoryCache extends Cache {
def getNow[E, A](request: Request[E, A]): Option[Promise[E, A]]
def lookupNow[E, A](request: Request[E, A]): Either[Promise[E, A], Promise[E, A]]
def putNow[E, A](request: Request[E, A], result: Promise[E, A]): Unit
Expand All @@ -105,7 +105,7 @@ object Cache {
ZIO.succeed(removeNow(request))
}

private final class NonExpiringCache(map: ConcurrentHashMap[Request[_, _], Promise[_, _]]) extends InMemory {
private final class NonExpiringCache(map: ConcurrentHashMap[Request[_, _], Promise[_, _]]) extends InMemoryCache {
private implicit val unsafe: Unsafe = Unsafe.unsafe

def getNow[E, A](request: Request[E, A]): Option[Promise[E, A]] =
Expand Down
4 changes: 2 additions & 2 deletions zio-query/shared/src/main/scala/zio/query/ZQuery.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1559,8 +1559,8 @@ object ZQuery {
}

cache match {
case cache: Cache.InMemory => foldPromise(cache.lookupNow(request))
case cache => CachedResult.Effectful(cache.lookup(request).flatMap(foldPromise(_).toZIO))
case cache: Cache.InMemoryCache => foldPromise(cache.lookupNow(request))
case cache => CachedResult.Effectful(cache.lookup(request).flatMap(foldPromise(_).toZIO))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ private[query] object BlockedRequests {
map: mutable.HashMap[Request[_, _], Exit[Any, Any]]
)(implicit trace: Trace): UIO[Unit] =
cache match {
case cache: Cache.InMemory =>
case cache: Cache.InMemoryCache =>
ZIO.succeedUnsafe { implicit unsafe =>
map.foreach { case (request: Request[Any, Any], exit) =>
cache
Expand Down

0 comments on commit 04f882b

Please sign in to comment.