NonExpiringCache
Basic self-fulfilling cache that uses Try
CONSIDER extending a different superclass since we don't want a cache that even has an expire method.
Type parameters
- K
-
they key type
- V
-
the value type
Value parameters
- carper
-
the function to carp about a problem, of type String=>Unit
- evaluate
-
the evaluationFunc function of type K=>Try[V] which will get the V value when it is otherwise unknown.
Attributes
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Expiring[K]trait K => Vclass Objecttrait Matchableclass AnyShow all
Members list
Type members
Inherited types
Define T as Try[V]
Value members
Concrete methods
method to remove a key from the cache
method to remove a key from the cache
Value parameters
- k
-
the key to the element which is to be expired.
Attributes
method to take action whenever a key value is actually fulfilled.
method to take action whenever a key value is actually fulfilled.
Value parameters
- k
-
the key of the element which has been fulfilled
- v
-
the value of the element which has been fulfilled
Attributes
Inherited methods
Composes two instances of Function1 in a new Function1, with this function applied first.
Composes two instances of Function1 in a new Function1, with this function applied first.
Type parameters
- A
-
the result type of function
g
Value parameters
- g
-
a function R => A
Attributes
- Returns
-
a new function
fsuch thatf(x) == g(apply(x)) - Inherited from:
- Function1
Return a V value for the given K value. This method is not normally called by users of a cache as it could result in an exception being thrown. Use get instead.
Return a V value for the given K value. This method is not normally called by users of a cache as it could result in an exception being thrown. Use get instead.
Value parameters
- k
-
the K value we are interested in
Attributes
- Returns
-
the corresponding V value
- Inherited from:
- AbstractFulfillingCache
Composes two instances of Function1 in a new Function1, with this function applied last.
Composes two instances of Function1 in a new Function1, with this function applied last.
Type parameters
- A
-
the type to which function
gcan be applied
Value parameters
- g
-
a function A => T1
Attributes
- Returns
-
a new function
fsuch thatf(x) == apply(g(x)) - Inherited from:
- Function1
Evaluate key k as an M[V]
Evaluate key k as an M[V]
Value parameters
- k
-
the key to be evaluated
Attributes
- Returns
-
a V wrapped in an M
- Inherited from:
- AbstractFulfillingCache
Value parameters
- k
-
the key to be evaluated
Attributes
- Returns
-
a V wrapped in an M
- Inherited from:
- TryFulfillingExpiringCache
Non-blocking call to get the value v from the cache.
Non-blocking call to get the value v from the cache.
Value parameters
- k
-
the key of the element which we wish to get
Attributes
- Returns
-
the value wrapped as a T
- Inherited from:
- Fulfilling
Attributes
- Inherited from:
- AbstractFulfillingCache
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
- Inherited from:
- AbstractFulfillingCache
Method to unwrap a value of type M[V].
Method to unwrap a value of type M[V].
Value parameters
- vm
-
the M[V] value to be unwrapped
Attributes
- Returns
-
the unwrapped V value
- Inherited from:
- AbstractFulfillingCache