package caqti
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=b8ea432820154ec095132c4f7b244b06cd8553e0b2035185b844d9c4f30af8bb
sha512=b7e3ad8e6a9b587db2d517e15cd42df2945148f9223b2fa6f4bc2bcdd2709d53549cca4b65e54511d22466e4c9aa7f0b9c17305a07505519d8bf81d95de629b8
doc/caqti.platform/Caqti_platform/Request_cache/Make/index.html
Module Request_cache.Make
Source
Parameters
module Elt : Lru.Weighted
Signature
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.