AbstractCache

trait AbstractCache[F[_], V] extends Cache[F, V] with LoggingSupport[F]

An abstract implementation of CacheAlg that takes care of some things that are common across all concrete implementations.

If you are writing a cache implementation, you probably want to extend this trait rather than extending CacheAlg directly.

Type Params
V

The value of types stored in the cache.

trait Cache[F, V]
trait CacheAlg[F, V]
class Object
trait Matchable
class Any

Value members

Abstract methods

protected def doGet(key: String): F[Option[V]]
protected def doPut(key: String, value: V, ttl: Option[Duration]): F[Unit]
protected def doRemove(key: String): F[Unit]
protected def doRemoveAll: F[Unit]

Concrete methods

final override def caching(keyParts: Any*)(ttl: Option[Duration])(f: => V)(implicit flags: Flags): F[V]
Definition Classes
override def cachingF(keyParts: Any*)(ttl: Option[Duration])(f: F[V])(implicit flags: Flags): F[V]
Definition Classes
override def cachingForMemoize(baseKey: String)(ttl: Option[Duration])(f: => V)(implicit flags: Flags): F[V]
Definition Classes
override def cachingForMemoizeF(baseKey: String)(ttl: Option[Duration])(f: F[V])(implicit flags: Flags): F[V]
Definition Classes
final override def get(keyParts: Any*)(implicit flags: Flags): F[Option[V]]
Definition Classes
final override def put(keyParts: Any*)(value: V, ttl: Option[Duration])(implicit flags: Flags): F[Unit]
Definition Classes
final override def remove(keyParts: Any*): F[Unit]
Definition Classes
final override def removeAll: F[Unit]
Definition Classes

Inherited methods

def close: F[Unit]

You should call this when you have finished using this Cache. (e.g. when your application shuts down)

You should call this when you have finished using this Cache. (e.g. when your application shuts down)

It will take care of gracefully shutting down the underlying cache client.

Note that you should not try to use this Cache instance after you have called this method.

Inherited from
CacheAlg
Inherited from
Cache
protected def logCacheHitOrMiss[A](key: String, result: Option[A]): F[Unit]

Output a debug log to record the result of a cache lookup

Output a debug log to record the result of a cache lookup

Type Params
A

the type of the cache value

Value Params
key

the key that was looked up

result

the result of the cache lookup

Inherited from
LoggingSupport
protected def logCachePut(key: String, ttl: Option[Duration]): F[Unit]

Output a debug log to record a cache insertion/update

Output a debug log to record a cache insertion/update

Value Params
key

the key that was inserted/updated

ttl

the TTL of the inserted entry

Inherited from
LoggingSupport
protected def logger: Logger[F]
Inherited from
LoggingSupport

Implicits

Implicits

implicit protected def F: Sync[F]