Module Cache.Service

Service injection point.

By default the library doesn't provide any caching services. All data stored in the cache is forgotten.

The caching service is provided by plugins, who register itself using Service.provide function. Only one caching service can be active at given moment.

Note: this interface is for implementing caching for data type. If you're using data type whose module T implements interface Data, then you can just use T.Data.Cache module. If you need to add caching to your custom data type, then use Regular, Opaque or Data.Make functors (in the order of preference).

val provide : service -> unit

provide service will substitute current caching service with a new service.

val request : 'a reader -> 'a writer -> 'a t

request reader writer returns a caching service for type 'a.