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: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. 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
  7. 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
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def ascendingKeys(limit: Option[Int] = None): Iterator[Any]

    Returns a snapshot view of the keys as an iterator, traversing the keys from the least likely to be retained to the most likely.

    Returns a snapshot view of the keys as an iterator, traversing the keys from the least likely to be retained to the most likely. Note that this is not constant time.

    limit

    No more than limit keys will be returned

    Definition Classes
    SimpleLruCacheCache
  10. def clear(): Unit

    Clears the cache by removing all entries.

    Clears the cache by removing all entries.

    Definition Classes
    SimpleLruCacheCache
  11. def clone(): AnyRef

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

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. 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
  16. final def getClass(): Class[_]

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

    Definition Classes
    AnyRef → Any
  18. val initialCapacity: Int

  19. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  20. def keys: Set[Any]

    Returns the set of keys in the cache, in no particular order Should return in roughly constant time.

    Returns the set of keys in the cache, in no particular order Should return in roughly constant time. Note that this number might not reflect the exact keys 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
  21. val maxCapacity: Int

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

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

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

    Definition Classes
    AnyRef
  25. 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
  26. 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
  27. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  28. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Cache[V]

Inherited from AnyRef

Inherited from Any

Ungrouped