Trait/Object

de.sciss.filecache

TxnProducer

Related Docs: object TxnProducer | package filecache

Permalink

trait TxnProducer[-A, B] extends AnyRef

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TxnProducer
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def acquire(key: A)(source: ⇒ B)(implicit tx: InTxn): Future[B]

    Permalink

    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 accept method returns true. 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's executionContext).

    If the source naturally returns a future, use acquireWith instead.

    When the value is not used any more, the caller should invoke release to 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)

  2. abstract def acquireWith(key: A)(source: ⇒ Future[B])(implicit tx: InTxn): Future[B]

    Permalink

    Acquires the cache value of a given key.

    Acquires the cache value of a given key. This method is equivalent to acquire but takes a source in the form of a future. See acquire for 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)

  3. abstract def config: Config[A, B]

    Permalink

    The configuration used to instantiate the producer.

  4. abstract def dispose()(implicit tx: InTxn): Unit

    Permalink

    Disposes this producer and makes it unavailable for future use.

    Disposes this producer and makes it unavailable for future use. Any attempt to call acquireWith or release after this invocation results in an IllegalStateException being thrown.

  5. implicit abstract def executionContext: ExecutionContext

    Permalink

    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.

  6. abstract def release(key: A)(implicit tx: InTxn): Unit

    Permalink

    Release a cache entry.

    Release a cache entry. The caller must have acquired the entry for the given key, using acquire or acquireWith. If the entry is not locked, this method will throw an IllegalStateException.

    Releasing the entry makes it possible to evict it from the cache if the cache capacity is exhausted.

    key

    the key to release

  7. abstract def usage(implicit tx: InTxn): Limit

    Permalink

    Reports the current statistics of the cache, which are number of entries, total size and age span.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  16. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped