spray.caching

SimpleLruCache

final class SimpleLruCache[V] extends Cache[V]

A thread-safe implementation of spray.caching.cache. The cache has a defined maximum number of entries it can store. After the maximum capacity is reached new entries cause old ones to be evicted in a last-recently-used manner, i.e. the entries that haven't been accessed for the longest time are evicted first.

Linear Supertypes
Cache[V], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SimpleLruCache
  2. Cache
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SimpleLruCache(maxCapacity: Int, initialCapacity: Int)

Type Members

  1. class Keyed extends AnyRef

    Definition Classes
    Cache

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. def apply(key: Any, genValue: () ⇒ Future[V])(implicit ec: ExecutionContext): Future[V]

    Returns either the cached Future for the given key or evaluates the given value generating function producing a Future[V].

    Returns either the cached Future for the given key or evaluates the given value generating function producing a Future[V].

    Definition Classes
    SimpleLruCacheCache
  5. def apply(key: Any): Keyed

    Selects the (potentially non-existing) cache entry with the given key.

    Selects the (potentially non-existing) cache entry with the given key.

    Definition Classes
    Cache
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clear(): Unit

    Clears the cache by removing all entries.

    Clears the cache by removing all entries.

    Definition Classes
    SimpleLruCacheCache
  8. def clone(): AnyRef

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

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def get(key: Any): Option[Future[V]]

    Retrieves the future instance that is currently in the cache for the given key.

    Retrieves the future instance that is currently in the cache for the given key. Returns None if the key has no corresponding cache entry.

    Definition Classes
    SimpleLruCacheCache
  13. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  15. val initialCapacity: Int

  16. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  17. val maxCapacity: Int

  18. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  21. def remove(key: Any): Option[Future[V]]

    Removes the cache item for the given key.

    Removes the cache item for the given key. Returns the removed item if it was found (and removed).

    Definition Classes
    SimpleLruCacheCache
  22. def size: Int

    Returns the upper bound for the number of currently cached entries.

    Returns the upper bound for the number of currently cached entries. Note that this number might not reflect the exact number of active, unexpired cache entries, since expired entries are only evicted upon next access (or by being thrown out by a capacity constraint).

    Definition Classes
    SimpleLruCacheCache
  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  24. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Cache[V]

Inherited from AnyRef

Inherited from Any

Ungrouped