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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request