Module: CacheMan

Defined in:
lib/cache_man/cacheable.rb,
lib/cache_man.rb,
lib/cache_man/errors.rb,
lib/cache_man/version.rb,
lib/cache_man/fetchable.rb

Overview

This concern adds support for a model to be fetched either from cache or from some other data store. The concern is only to be included in classes that implement a class method find to fetch the object from a data store other than cache. If such a class method does not exist, you can write your own custom finder module for the model. By convention, the finder module should be app/models/<model_name>/finder.rb The first attempt to fetch a model will be from cache. If that fails, then it will fallback to fetching from a different data store. If the cache has soft expired then it will return the stale object, but will let the cache update asynchronously.

Defined Under Namespace

Modules: Cacheable, Fetchable Classes: CacheManError, FinderNotFound

Constant Summary collapse

VERSION =
"0.0.2"