Module ReWeb.Cache

Concurrent safe caching.

The cache module here uses Lwt to ensure that caches are accessed serially to prevent inconsistent data accesses.

module type S = sig ... end

Aside from make and access, the rest of the functions in this interface are similar to the ones in Hashtbl, so you can use those as a reference.

module Ephemeral (Key : Stdlib.Hashtbl.SeededHashedType) : S with type key = Key.t

Ephemeral(Key) is a module that manages an ephemeral concurrent cache. An ephemeral cache is one whose bindings are deleted as soon as its keys go out of scope.

module InMemory (Key : Stdlib.Hashtbl.SeededHashedType) : S with type key = Key.t

InMemory(Key) is a module that manages a concurrent in-memory cache.

module IntKey : Stdlib.Hashtbl.SeededHashedType with type t = int

IntKey is a module that can be used to create a cache with int keys.

module Make (T : Stdlib.Hashtbl.SeededS) : S with type key = T.key

Make(T) is a module that manages a concurrent cache with the persistence characteristics offered by the Table module.

module StringKey : Stdlib.Hashtbl.SeededHashedType with type t = string

StringKey is a module that can be used to create a cache with string keys.