package ocsigenserver
Install
Dune Dependency
Authors
Maintainers
Sources
md5=001e22ec2da3ab08840f934a8f005859
sha512=59f36fdf0a640117aa562d1d9ef96b7146843d9b72d71d01366640521405550074e03267fb388c5e685542781fc4bce763818a36cf05c0e033fae5e51c2f1496
doc/ocsigenserver.baselib/Ocsigen_cache/Make/class-cache/index.html
Class Make.cache
Source
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