Displaying 1 result from an estimated 1 matches for "cached_resourc".
Did you mean:
cached_resource
2007 Jan 05
0
ActiveResource cache using memcache-client
...in activeresource. The 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::MemC...