package ocsigenserver
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=acb09f06430cb8eefd83a849af6450af
sha512=f2c5111a02989572a19706ca5238d3740c4c06d97b0e1791ae0e06665666574ada94421d10edee636042984ab9df6357b4febbb4edc34b01e72619027b95bfec
doc/ocsigenserver.baselib/Ocsigen_cache/Make/class-cache/index.html
Class Make.cache
new cache finder ?timer size creates a cache object where finder is the function responsible for retrieving non-cached data, timer (if any) is the life span of cached values (in seconds) (values in the cache are removed after their time is up) and size is the upper bound to the number of simultaneoulsy cached elements.
Whenever a value is found (using find method), it's lifespan is set to timer (or not if the cache is not time bounded). If the value was already cached, it's lifespan is reset to timer.
Using timer allow one to create a cache bounded both in space and time. It is to be noted that real lifespan of values is always slightly greater than timer.
Find the cached value associated to the key, or binds this value in the cache using the function finder passed as argument to create, and returns this value
Find the cached value associated to the key. Raises Not_found if the key is not present in the cache
method remove : A.key -> unit