Displaying 1 result from an estimated 1 matches for "cachedresourc".
Did you mean:
cachedresource
2007 Jan 05
0
ActiveResource cache using memcache-client
...he code
populates a local memcache daemon and uses that cache for future find
requests. I''m posting it here to get whatever feedback people have.
I''m most interested in the pro/con of inheritance over a mixin and how
such a module might be tested.
$ cat lib/cached_resource.rb
# CachedResource uses memcache to cache HTTP responses from a
# RESTful web application.
#
class CachedResource < ActiveResource::Base
begin
@@cache = MemCache.new(''localhost'')
# test the connection to the Memcache server
@@cache.get(1)
rescue MemCache::MemCacheError
@@cach...