Patella
Gem for the RailsConf 2012 talk Patella: It's Memoization into Memcached calculated in the background with Resque. www.slideshare.net/jdwyah/patella-railsconf-2012
Installation
Add this line to your application's Gemfile:
gem 'patella'
And then execute:
$ bundle
Or install it yourself as:
$ gem install patella
Usage
def self.my_slow_method(user_id)
all_notifications_for(User.find(user_id))
end
patella_reflex :notification_unread_count, :expires_in => 3.minutes, :class_method => true
See the tests for more examples
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request