Hitnmiss::RedisDriver
This gem provides a Redis driver for the Hitnmiss caching library. It does this so that people can easily use Redis as a cache store when using Hitnmiss.
Installation
Add this line to your application's Gemfile:
gem 'hitnmiss-redis_driver'
And then execute:
$ bundle
Or install it yourself as:
$ gem install hitnmiss-redis_driver
Usage
You can use this driver by simply doing the following in your Hitnmiss cache repository.
Register the driver with Hitnmiss
in your application using the following.
Hitnmiss.register_driver(:redis_driver, Hitnmiss::RedisDriver.new("redis://your_redis_url"))
Then use the registered driver in your cache repository as follows.
# lib/cache_repositories/most_recent_price.rb
class MostRecentPrice
include Hitnmiss::Repository
driver :redis_driver
end
Thats it. Note: Registering a driver basically creates a singleton version of that driver instance. So, if you want multiple redis drivers with different configurations you will need to register multiple instances of the redis driver.
More details about how to set drivers can be found at Hitnmiss.
Contributing
If you are interested in contributing to Hitnmiss. There is a guide (both code and general help) over in CONTRIBUTING.
License
The gem is available as open source under the terms of the MIT License.