MemoryCache Module
Effects for caching values in the environment's IMemoryCache.
Functions and values
| Function or value |
Description
|
Full Usage:
getOrCreate key f
Parameters:
'a
-
The key of the cached value.
f : ICacheEntry -> Effect<'a0, 'entry, 'Err>
-
Creates the effect that produces the value, when it is not cached.
Returns: Effect<'a0, 'entry, 'Err>
Type parameters: 'a, 'a, 'entry, 'Err (requires :> Orsak.ICacheProvider) |
Gets the value cached under key, or runs the effect created by f to create and cache it. f is given the new cache entry, to set e.g. its expiration.
Example
val getCustomer: id: int -> 'a
val id: int
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int val ignore: value: 'T -> unit
|
Full Usage:
updateOrDefault key defaultValue f
Parameters:
string
-
The key of the cached value.
defaultValue : 'entry
-
The value to cache, and return, when nothing is cached under the key.
f : 'entry -> Effect<'a, 'entry, 'Err>
-
Creates the effect that produces the updated value from the cached one.
Returns: Effect<'a, 'entry, 'Err>
The updated value, or defaultValue.
Type parameters: 'entry, 'a, 'Err (requires :> Orsak.ICacheProvider) |
Updates the value cached under key with the effect created by f, or caches defaultValue if there is none.
|
Orsak