Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Hotpants make you sure of yourself

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples Model integration is the key. January 01, 2011
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 Gemfile
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 hotpants.gemspec
README.md

"Hotpants! Make ya sure of yourself. Good lord!"

Hotpants lets you add caching to your existing model classes. As your app grows, you often find yourself needing to keep counters, expensive calculations, and even indexes for common queries in memory. Memcached makes that possible, Hotpants makes it really easy to do.

Here's an example model:

class User < AR::Base
  include Hotpants

  counter :friends

  value :something, :with => :calculate_something
  index :username
end

Counters are atomically modified values in memcached. Value are simple values you want to store in memcached. An index is a lookup table for the named attribute of the host model. A lock is a semaphore maintained by memcached.

Hotpants is heavily influenced by redis-objects and several chats with John Nunemaker and Jesse Newland.

TODO

Note: this is a spike on ideas I've been toying with. It is rated not-production-ready, somewhat-practical by MPAA.

  • Implement lists? (using prepend/append)
  • Implement locks?
  • Should it be possible to clear an entire index? Efficiently?
Something went wrong with that request. Please try again.