trait TxnProducer[-A, B] extends AnyRef
- Alphabetic
- By Inheritance
- TxnProducer
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Abstract Value Members
- abstract def acquire(key: A)(source: => B)(implicit tx: InTxn): Future[B]
Acquires the cache value of a given key.
Acquires the cache value of a given key. A cache entry, like an exclusive lock, can only be acquired by one instance at a time, therefore if the entry is still locked, this method throws an immediate
IllegalStateException.If the entry is still found on disk, it will be re-used, given that the configuration's
acceptmethod returnstrue. If the entry is not found or not accepted, a new value is produced by spawning the source in its own future (using the configuration'sexecutionContext).If the source naturally returns a future, use
acquireWithinstead.When the value is not used any more, the caller should invoke
releaseto make it possible for the entry to be evicted when over capacity. Only a released entry can be re-acquired.- key
the key to look up
- source
the source which is only used if the entry was not found or not accepted
- returns
the future value of the cache entry (this might result in an I/O exception for example)
- abstract def acquireWith(key: A)(source: => Future[B])(implicit tx: InTxn): Future[B]
Acquires the cache value of a given key.
Acquires the cache value of a given key. This method is equivalent to
acquirebut takes a source in the form of a future. Seeacquirefor more details on the mechanism and requirements of this process.- key
the key to look up
- source
the source which is only used if the entry was not found or not accepted
- returns
the future value of the cache entry (this might result in an I/O exception for example)
- abstract def config: Config[A, B]
The configuration used to instantiate the producer.
- abstract def dispose()(implicit tx: InTxn): Unit
Disposes this producer and makes it unavailable for future use.
Disposes this producer and makes it unavailable for future use. Any attempt to call
acquireWithorreleaseafter this invocation results in anIllegalStateExceptionbeing thrown. - implicit abstract def executionContext: ExecutionContext
The context used by the cache to spawn future computations.
The context used by the cache to spawn future computations. This is directly taken from its configuration, and is provided here for clients to easily import it as an implicit value, e.g. to create its own futures.
- abstract def release(key: A)(implicit tx: InTxn): Unit
Release a cache entry.
Release a cache entry. The caller must have acquired the entry for the given key, using
acquireoracquireWith. If the entry is not locked, this method will throw anIllegalStateException.Releasing the entry makes it possible to evict it from the cache if the cache capacity is exhausted.
- key
the key to release
- abstract def usage(implicit tx: InTxn): Limit
Reports the current statistics of the cache, which are number of entries, total size and age span.
Concrete 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
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[java.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()