Packages

t

scalacache

AbstractCache

trait AbstractCache[V] extends Cache[V] with LoggingSupport

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.

V

The value of types stored in the cache.

Linear Supertypes
LoggingSupport, Cache[V], CacheAlg[V], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AbstractCache
  2. LoggingSupport
  3. Cache
  4. CacheAlg
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

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

    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

    Definition Classes
    CacheAlg
  2. abstract def config: CacheConfig
    Definition Classes
    Cache
  3. abstract def doGet[F[_]](key: String)(implicit mode: Mode[F]): F[Option[V]]
    Attributes
    protected
  4. abstract def doPut[F[_]](key: String, value: V, ttl: Option[Duration])(implicit mode: Mode[F]): F[Any]
    Attributes
    protected
  5. abstract def doRemove[F[_]](key: String)(implicit mode: Mode[F]): F[Any]
    Attributes
    protected
  6. abstract def doRemoveAll[F[_]]()(implicit mode: Mode[F]): F[Any]
    Attributes
    protected
  7. abstract def logger: Logger
    Attributes
    protected
    Definition Classes
    LoggingSupport

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. final def caching[F[_]](keyParts: Any*)(ttl: Option[Duration] = None)(f: ⇒ V)(implicit mode: Mode[F], flags: Flags): F[V]

    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

    Definition Classes
    AbstractCacheCacheAlg
  6. def cachingF[F[_]](keyParts: Any*)(ttl: Option[Duration] = None)(f: ⇒ F[V])(implicit mode: Mode[F], flags: Flags): F[V]

    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

    Definition Classes
    AbstractCacheCacheAlg
  7. def cachingForMemoize[F[_]](baseKey: String)(ttl: Option[Duration] = None)(f: ⇒ V)(implicit mode: Mode[F], flags: Flags): F[V]
    Definition Classes
    AbstractCacheCache
  8. def cachingForMemoizeF[F[_]](baseKey: String)(ttl: Option[Duration])(f: ⇒ F[V])(implicit mode: Mode[F], flags: Flags): F[V]
    Definition Classes
    AbstractCacheCache
  9. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def get[F[_]](keyParts: Any*)(implicit mode: Mode[F], flags: Flags): F[Option[V]]

    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

    Definition Classes
    AbstractCacheCacheAlg
  14. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. def logCacheHitOrMiss[A](key: String, result: Option[A]): 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

    A

    the type of the cache value

    key

    the key that was looked up

    result

    the result of the cache lookup

    Attributes
    protected
    Definition Classes
    LoggingSupport
  18. def logCachePut(key: String, ttl: Option[Duration]): Unit

    Output a debug log to record a cache insertion/update

    Output a debug log to record a cache insertion/update

    key

    the key that was inserted/updated

    ttl

    the TTL of the inserted entry

    Attributes
    protected
    Definition Classes
    LoggingSupport
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def put[F[_]](keyParts: Any*)(value: V, ttl: Option[Duration])(implicit mode: Mode[F], flags: Flags): F[Any]

    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

    Definition Classes
    AbstractCacheCacheAlg
  23. final def remove[F[_]](keyParts: Any*)(implicit mode: Mode[F]): F[Any]

    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.

    Definition Classes
    AbstractCacheCacheAlg
  24. final def removeAll[F[_]]()(implicit mode: Mode[F]): F[Any]

    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.

    Definition Classes
    AbstractCacheCacheAlg
  25. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  26. def toString(): String
    Definition Classes
    AnyRef → Any
  27. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from LoggingSupport

Inherited from Cache[V]

Inherited from CacheAlg[V]

Inherited from AnyRef

Inherited from Any

Ungrouped