← ZIO Cache docs

ScopedCache

zio.cache.ScopedCache
See theScopedCache companion class
object ScopedCache

Attributes

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

Members list

Type members

Types

type Finalizer = (=> Exit[Any, Any]) => UIO[Any]

Attributes

Source
ScopedCache.scala

Value members

Concrete methods

def make[Key, Environment, Error, Value](capacity: Int, timeToLive: Duration, lookup: ScopedLookup[Key, Environment, Error, Value]): ZIO[Environment & Scope, Nothing, ScopedCache[Key, Error, Value]]

Constructs a new cache with the specified capacity, time to live, and lookup function.

Constructs a new cache with the specified capacity, time to live, and lookup function.

Attributes

Source
ScopedCache.scala
def makeWith[Key, Environment, Error, Value](capacity: Int, scopedLookup: ScopedLookup[Key, Environment, Error, Value])(timeToLive: Exit[Error, Value] => Duration): URIO[Environment & Scope, ScopedCache[Key, Error, Value]]

Constructs a new cache with the specified capacity, time to live, and lookup function, where the time to live can depend on the Exit value returned by the lookup function.

Constructs a new cache with the specified capacity, time to live, and lookup function, where the time to live can depend on the Exit value returned by the lookup function.

Attributes

Source
ScopedCache.scala