com.twitter

cache

package cache

Visibility
  1. Public
  2. All

Type Members

  1. class ConcurrentMapCache[K, V] extends FutureCache[K, V]

    A com.twitter.cache.FutureCache backed by a java.util.concurrent.ConcurrentMap

    A com.twitter.cache.FutureCache backed by a java.util.concurrent.ConcurrentMap

    Any correct implementation should make sure that you evict failed results, and don't interrupt the underlying request that has been fired off. EvictingCache and Future#interrupting are useful tools for building correct FutureCaches. A reference implementation for caching the results of an asynchronous function with a ConcurrentMap can be found at FutureCache$.fromMap.

  2. abstract class FutureCache[K, V] extends AnyRef

    FutureCache is used to represent an in-memory, in-process, asynchronous cache.

    FutureCache is used to represent an in-memory, in-process, asynchronous cache.

    Every cache operation is atomic.

    Any correct implementation should make sure that you evict failed results, and don't interrupt the underlying request that has been fired off. EvictingCache and Future#interrupting are useful tools for building correct FutureCaches. A reference implementation for caching the results of an asynchronous function can be found at FutureCache$.default.

  3. abstract class FutureCacheProxy[K, V] extends FutureCache[K, V]

    A proxy for FutureCaches, useful for wrap-but-modify.

  4. sealed trait Mod[+A] extends AnyRef

Value Members

  1. object AsyncMemoize

  2. object EvictingCache

  3. object FutureCache

    The FutureCache object provides the public interface for constructing FutureCaches.

    The FutureCache object provides the public interface for constructing FutureCaches. Once you've constructed a basic FutureCache, you should almost always wrap it with default. Normal usage looks like:

    val fn: K => Future[V] val map = (new java.util.concurrent.ConcurrentHashMap[K, V]()).asScala val cachedFn: K => Future[V] = FutureCache.default(fn, FutureCache.fromMap(map))

    We typically recommend that you use Guava Caches. There's an API that makes it easy to use Guava caches, and can be found in the util-collection lib. The object is called com.twitter.cache.guava.Guava$.

  4. object Mod

  5. package guava

Ungrouped