cloudant/ddoc_cache — pull request #6 by kocolosk (2014-12-11 21:23:20+00:00)
Title: Allow custom cache objects using callback modules

This patch adds a new register/1 export which takes the name of a callback module. The callback module must define a recover/1 function which accepts the name of a database and returns {ok, term()}. The term will be cached as if it were a design doc. For the sake of simplicity each custom cache object is evicted when any ddoc in the database changes.

Once a custom callback module has been registered the object associated with the module can be retrieved via ddoc_cache:open(DbName, Mod).

BugzID: 42707