gacache
Types
Actions are passed to the Cache to interact with its Store
pub type Action(key, value) {
Set(key: key, value: value)
Get(ret: process.Subject(Result(value, Error)), key: key)
Clear(key: key)
Keys(ret: process.Subject(List(key)))
Reset
Raw(ret: process.Subject(Store(key, value)))
Merge(store: Store(key, value))
Stop
}
Constructors
-
Set(key: key, value: value) -
Get(ret: process.Subject(Result(value, Error)), key: key) -
Clear(key: key) -
Keys(ret: process.Subject(List(key))) -
Reset -
Raw(ret: process.Subject(Store(key, value))) -
Merge(store: Store(key, value)) -
Stop
Functions
pub fn clear(cache: Subject(Action(a, b)), key: a) -> Nil
Removes the Value associated with the provided Key from the Store
pub fn merge(
cache: Subject(Action(a, b)),
new_store: Dict(a, b),
) -> Nil
Merges the Store with the provided Store using dict:merge/2
pub fn raw(
cache: Subject(Action(a, b)),
) -> Result(Dict(a, b), Error)
Returns the Store, avoid if possible
pub fn set(cache: Subject(Action(a, b)), key: a, value: b) -> Nil
Updates the Store with key=value