Trait

scalacache

CacheAlg

Related Doc: package scalacache

Permalink

trait CacheAlg[V] extends AnyRef

Abstract algebra describing the operations a cache can perform

V

The value of types stored in the cache.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CacheAlg
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def caching[F[_]](keyParts: Any*)(ttl: Option[Duration])(f: ⇒ V)(implicit mode: Mode[F], flags: Flags): F[V]

    Permalink

    Get a value from the cache if it exists.

    Get a value from the cache if it exists. Otherwise compute it, insert it into the cache, and return it.

    F

    The type of container in which the result will be wrapped. This is decided by the mode.

    keyParts

    The cache key

    ttl

    The time-to-live to use when inserting into the cache. The cache entry will expire after this time has elapsed.

    f

    A block that computes the value

    mode

    The operation mode, which decides the type of container in which to wrap the result

    flags

    Flags used to conditionally alter the behaviour of ScalaCache

    returns

    The value, either retrieved from the cache or computed

  2. abstract def cachingF[F[_]](keyParts: Any*)(ttl: Option[Duration])(f: ⇒ F[V])(implicit mode: Mode[F], flags: Flags): F[V]

    Permalink

    Get a value from the cache if it exists.

    Get a value from the cache if it exists. Otherwise compute it, insert it into the cache, and return it.

    F

    The type of container in which the result will be wrapped. This is decided by the mode.

    keyParts

    The cache key

    ttl

    The time-to-live to use when inserting into the cache. The cache entry will expire after this time has elapsed.

    f

    A block that computes the value wrapped in a container

    mode

    The operation mode, which decides the type of container in which to wrap the result

    flags

    Flags used to conditionally alter the behaviour of ScalaCache

    returns

    The value, either retrieved from the cache or computed

  3. abstract def close[F[_]]()(implicit mode: Mode[F]): F[Any]

    Permalink

    You should call this when you have finished using this Cache.

    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.

    F

    The type of container in which the result will be wrapped. This is decided by the mode.

    mode

    The operation mode, which decides the type of container in which to wrap the result

  4. abstract def get[F[_]](keyParts: Any*)(implicit mode: Mode[F], flags: Flags): F[Option[V]]

    Permalink

    Get a value from the cache

    Get a value from the cache

    F

    The type of container in which the result will be wrapped. This is decided by the mode.

    keyParts

    The cache key

    mode

    The operation mode, which decides the type of container in which to wrap the result

    flags

    Flags used to conditionally alter the behaviour of ScalaCache

    returns

    The appropriate value, if it was found in the cache

  5. abstract def put[F[_]](keyParts: Any*)(value: V, ttl: Option[Duration] = None)(implicit mode: Mode[F], flags: Flags): F[Any]

    Permalink

    Insert a value into the cache, optionally setting a TTL (time-to-live)

    Insert a value into the cache, optionally setting a TTL (time-to-live)

    F

    The type of container in which the result will be wrapped. This is decided by the mode.

    keyParts

    The cache key

    value

    The value to insert

    ttl

    The time-to-live. The cache entry will expire after this time has elapsed.

    mode

    The operation mode, which decides the type of container in which to wrap the result

    flags

    Flags used to conditionally alter the behaviour of ScalaCache

  6. abstract def remove[F[_]](keyParts: Any*)(implicit mode: Mode[F]): F[Any]

    Permalink

    Remove the given key and its associated value from the cache, if it exists.

    Remove the given key and its associated value from the cache, if it exists. If the key is not in the cache, do nothing.

    F

    The type of container in which the result will be wrapped. This is decided by the mode.

    keyParts

    data to be used to generate the cache key. This could be as simple as just a single String. See CacheKeyBuilder.

  7. abstract def removeAll[F[_]]()(implicit mode: Mode[F]): F[Any]

    Permalink

    Delete the entire contents of the cache.

    Delete the entire contents of the cache. Use wisely!

    F

    The type of container in which the result will be wrapped. This is decided by the mode.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  16. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped