class ServiceFactoryCache[Key, Req, Rep] extends Closable
A "read-through" cache of service factories.
Eviction is based on cache size and idle time:
1. When the cache is full, a miss evicts the most idle factory. When no underlying factories are idle, a one-shot factory is created. This doesn't necessarily guarantee good performance: one-shots could be created constantly for a hot cache key, but should work well when there are a few hot keys.
2. Periodically evict factories that are idle for at least one TTI (time-to-idle) period. An idle factory could remain in the cache for up to (TTI * 2) minutes, with the caveat that we never expire the last, least-idle entry.
- Alphabetic
- By Inheritance
- ServiceFactoryCache
- Closable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ServiceFactoryCache(newFactory: (Key) => ServiceFactory[Req, Rep], timer: Timer, statsReceiver: StatsReceiver = NullStatsReceiver, maxCacheSize: Int = 8, tti: Duration = 10.minutes)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply(key: Key, conn: ClientConnection): Future[Service[Req, Rep]]
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def close(deadline: Time): Future[Unit]
- Definition Classes
- ServiceFactoryCache → Closable
- def close(after: Duration): Future[Unit]
- Definition Classes
- Closable
- final def close(): Future[Unit]
- Definition Classes
- Closable
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()