Request_cache.Make
Sourcemodule Elt : Lru.Weighted
create dialect
creates a cache of prepared queries for requests specialized for dialect
.
find_and_promote cache request
promotes and returns the data associated with request
in cache
, if any.
Given the hard precondition that request
is not bound in cache
, as verified by find_and_promote
, add cache request data
binds it to data
.
remove_and_discard cache request
removes the binding for request
from cache
. The caller is assumed to have just extracted the element with find_and_promote
and is resposible for releasing related resources.
deallocate request
returns the entry for request
, if any, along with a function to remove it from the cache.
elements cache
is an arbitrarily ordered list of all elements, whether associated with a static or dynamic request.
trim ?promote_count cache
carrious out some work trimming elements from the dynamic LRU cache. The call promotes up to max_promote_count
elements, which are alive according to the garbage collector, and stop at the next one. It is up to the caller to free any resources associated with the returned elements.
clear cache
removes all entries form cache
. Elements are not returned, since this function may be used after a connection reset which invalidates the cached resources, but can be requested by calling elements
first.