package ocsigenserver
Install
Dune Dependency
Authors
Maintainers
Sources
md5=528d59a39e9bda4c628022b4f1e0951e
sha512=1b8653487722ad26c0c0bfcf820402a783018039ce8b7c749ffb57bc80eeb1234464950ee639cb951c5b3dde1b4e85a992dfbbc782d55e7c2a356ff2f28a3917
doc/ocsigenserver.baselib/Ocsigen_cache/Dlist/index.html
Module Ocsigen_cache.Dlist
Source
Doubly-linked lists with maximum number of entries, and (possibly) limited lifespan for entries.
Create a dlist. It takes the maximum length of the list as parameter. The optional ?timer
parameter sets a maximum lifetime for elements (in seconds).
Adds an element to the list, and possibly returns the element that has been removed if the maximum size was exceeded.
Removes an element from its list. If it is not in a list, it does nothing. If it is in a list, it calls the finaliser, then removes the element. If the finaliser fails with an exception, the element is removed and the exception is raised again.
Removes the element from its list without finalising, then adds it as newest.
remove the n oldest values (or less if the list is not long enough) ; returns the list of removed values
fold over the elements from the cache starting from the newest to the oldest
fold over the elements from the cache starting from the oldest to the newest
Move a node from one dlist to another one, without finalizing. If one value is removed from the destination list (because its maximum size is reached), it is returned (after finalisation).
change the maximum size ; returns the list of removed values, if any.
set a function to be called automatically on a piece of data just before it disappears from the list (either by explicit removal or because the maximum size is exceeded)
set a function to be called automatically on a piece of data just after it disappears from the list (either by explicit removal or because the maximum size is exceeded)