MruCache<'Token, 'Key, 'Value> Type
Simple priority caching for a small number of key/value associations. This cache may age-out results that have been Set by the caller. Because of this, the caller must be able to tolerate values that aren't what was originally passed to the Set function. Concurrency: This collection is thread-safe, though concurrent use may result in different threads seeing different live sets of cached items. - areSimilar: Keep at most once association for two similar keys (as given by areSimilar)
Constructors
Constructor |
Description
|
Full Usage:
MruCache(keepStrongly, areSame, ?isStillValid, ?areSimilar, ?requiredToKeep, ?keepMax)
Parameters:
int
areSame : 'Key * 'Key -> bool
?isStillValid : 'Key * 'Value -> bool
?areSimilar : 'Key * 'Key -> bool
?requiredToKeep : 'Value -> bool
?keepMax : int
Returns: MruCache<'Token, 'Key, 'Value>
|
|
Instance members
Instance member |
Description
|
Full Usage:
this.Clear
Parameters:
'Token
|
Clear out the cache.
|
Full Usage:
this.ContainsSimilarKey
Parameters:
'Token
key : 'Key
Returns: bool
|
Get the similar (subsumable) value for the given key or
|
Full Usage:
this.RemoveAnySimilar
Parameters:
'Token
key : 'Key
|
Remove the given value from the mru cache.
|
Full Usage:
this.Resize
Parameters:
'Token
newKeepStrongly : int
?newKeepMax : int
|
Resize
|
Full Usage:
this.Set
Parameters:
'Token
key : 'Key
value : 'Value
|
Set the given key.
|
Full Usage:
this.TryGet
Parameters:
'Token
key : 'Key
Returns: 'Value option
|
Get the value for the given key or None, but only if entry is still valid
|
Full Usage:
this.TryGetAny
Parameters:
'Token
key : 'Key
Returns: 'Value option
|
Get the value for the given key or
|
Full Usage:
this.TryGetSimilar
Parameters:
'Token
key : 'Key
Returns: 'Value option
|
Get the value for the given key or None, but only if entry is still valid. Skips `areSame` checking unless `areSimilar` is not provided.
|
Full Usage:
this.TryGetSimilarAny
Parameters:
'Token
key : 'Key
Returns: 'Value option
|
Get the value for the given key or
|