cacheable

package cacheable

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. cacheable
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. trait Cache extends AnyRef

  2. case class CacheConfig(cache: Cache, keyGenerator: KeyGenerator = KeyGenerator.defaultGenerator) extends Product with Serializable

    Configuration to be used when interacting with a cache.

  3. trait KeyGenerator extends AnyRef

Value Members

  1. object KeyGenerator

  2. object Macros

  3. def cacheable[A](ttl: Duration)(f: ⇒ A)(implicit cacheConfig: CacheConfig): A

    Perform the given operation and memoize its result to a cache before returning it.

    Perform the given operation and memoize its result to a cache before returning it. If the result is already in the cache, return it without performing the operation.

    The result is stored in the cache with the given TTL. It will be evicted when the TTL is up.

    Note that if the result is currently in the cache, changing the TTL has no effect. TTL is only set once, when the result is added to the cache.

    A

    type of the value to be cached

    ttl

    Time To Live. How long the result should be stored in the cache.

    f

    function that returns some result. This result is the valued that will be cached.

    cacheConfig

    cache configuration

    returns

    the result, either retrieved from the cache or calculated by executing the function f

    Annotations
    @macroImpl( ... )
  4. def cacheable[A](f: ⇒ A)(implicit cacheConfig: CacheConfig): A

    Perform the given operation and memoize its result to a cache before returning it.

    Perform the given operation and memoize its result to a cache before returning it. If the result is already in the cache, return it without performing the operation.

    The result is stored in the cache without a TTL, so it will remain until it is naturally evicted.

    A

    type of the value to be cached

    f

    function that returns some result. This result is the valued that will be cached.

    cacheConfig

    cache configuration

    returns

    the result, either retrieved from the cache or calculated by executing the function f

    Annotations
    @macroImpl( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped