MemoryCache

io.chrisdavenport.mules.MemoryCache$
See theMemoryCache companion class

Attributes

Companion:
class
Source:
MemoryCache.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Classlikes

case class MemoryCacheItem[A](item: A, itemExpiration: Option[TimeSpec])

Attributes

Source:
MemoryCache.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def inSingleImmutableMap[G[_] : Sync, F[_] : Async, K, V](defaultExpiration: Option[TimeSpec]): G[MemoryCache[F, K, V]]

Cache construction is Synchronous

Cache construction is Synchronous

Otherwise a copy paste of [[#ofSingleImmutableMap() ofSingleImmutableMap]]

Attributes

Source:
MemoryCache.scala
def liftToAuto[F[_] : Temporal, K, V](memoryCache: MemoryCache[F, K, V], checkOnExpirationsEvery: TimeSpec): Resource[F, Unit]

Initiates a background process that checks for expirations every certain amount of time.

Initiates a background process that checks for expirations every certain amount of time.

Attributes

checkOnExpirationsEvery:

How often the expiration process should check for expired keys.

memoryCache:

The cache to check and expire automatically.

Returns:

an Resource[F, Unit] that will keep removing expired entries in the background.

Source:
MemoryCache.scala
def ofConcurrentHashMap[F[_] : Async, K, V](defaultExpiration: Option[TimeSpec], initialCapacity: Int, loadFactor: Float, concurrencyLevel: Int): F[MemoryCache[F, K, V]]

Attributes

Source:
MemoryCache.scala
def ofMapRef[F[_] : Temporal, K, V](mr: MapRef[F, K, Option[MemoryCacheItem[V]]], defaultExpiration: Option[TimeSpec]): MemoryCache[F, K, V]

Attributes

Source:
MemoryCache.scala
def ofShardedImmutableMap[F[_] : Temporal, K, V](shardCount: Int, defaultExpiration: Option[TimeSpec]): F[MemoryCache[F, K, V]]

Attributes

Source:
MemoryCache.scala
def ofSingleImmutableMap[F[_] : Temporal, K, V](defaultExpiration: Option[TimeSpec]): F[MemoryCache[F, K, V]]

Create a new cache with a default expiration value for newly added cache items.

Create a new cache with a default expiration value for newly added cache items.

Items that are added to the cache without an explicit expiration value (using insert) will be inserted with the default expiration value.

If the specified default expiration value is None, items inserted by insert will never expire.

Attributes

Source:
MemoryCache.scala