Plasma GitLab Archive
Projects Blog Knowledge

Module Cache_server


module Cache_server: sig .. end
Cache server

class type cache_config = object .. end
Configuration data for a server
type cache_instance 
A cache server instance
val create : cache_config -> cache_instance
Creates a cache instance for the passed cache_config
val bind : Rpc_server.t -> cache_instance -> unit
Binds the cache procedures in the passed RPC server. One can bind the cache to several servers, or even to no servers if only local accesses happen.
val activate : Unixqueue.event_system -> cache_instance -> unit
Activates the cache: Loads contents from files, and establishes timers. Must be called after bind.
val save : cache_instance -> unit
Saves the complete instance immediately to disk
val verify : log:(string -> unit) -> cache_instance -> unit
Runs a routine that checks the structure of the cache instance. Messages are printed to log.

type full_key = {
   key : Cache_client.key;
   modulo : int;
}
The key and the modulo (number of servers)
val set_directly : cache_instance ->
full_key ->
string ->
Cache_client.timestamp ->
Cache_client.set_options -> [ `Not_stored | `Stored ]
Modifies the cache directly
val get_directly : cache_instance ->
full_key ->
Cache_client.get_options -> [ `Found of Cache_client.entry | `Not_found ]
Reads from the cache directly
val delete_directly : cache_instance ->
full_key ->
Cache_client.timestamp -> Cache_client.delete_options -> unit
Deletes directly in the cache
val clear_directly : cache_instance -> unit
Clears the whole cache directly
val get_config : cache_instance -> Cache_client.config
Get the cache's config
val set_config : cache_instance -> Cache_client.config -> unit
Set the cache's config
val get_stats : cache_instance -> Cache_client.stats
Get the statistics
val clear_counters : cache_instance -> unit
Reset the statistics
val shutdown : cache_instance -> unit
Shuts the instance down. This deletes any timers, and stops any save operations currently being performed. It does not stop the RPC servers, however, because the cache instance does not remember them, i.e. it is the task of the user of this module to stop the RPC servers to which the instance has been bound.
This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml