Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > regarding memcache client...

Reply
Thread Tools

regarding memcache client...

 
 
hemant kumar
Guest
Posts: n/a
 
      08-30-2006

Hi,

I am using memcache-client written by beloved eric hodel for session
caching in rails, and but I would like to use this for some in-memory
caching in my other programs.

I am not able to use it outside rails somehow. require 'memcache' throws, no
such file to load, when I have the gem in
"/usr/lib/ruby/gems/1.8/gems/memcache-client-1.3/ and rails is using it
allright.

The API for memcache also doesn't make it clear, how do I use it in my own
applications. can anyone clarify on this?

Also, when using CachedModel for activerecord caching..how exactly it works?
how often will it do read and write to db?

What exactly is meant by "in-process" caching that CacheModel does?
Also the after_filter stuff that is supposed to flush the local cache in
rails, I would like to know what is meant by "local cache" stuff and how it
determines when to flush that content?



 
Reply With Quote
 
 
 
 
Cliff Cyphers
Guest
Posts: n/a
 
      08-30-2006
If mechanize was installed as a gem do you have:
require 'rubygems'
before the:
require 'mechanize'

hemant kumar wrote:
> Hi,
>
> I am using memcache-client written by beloved eric hodel for session
> caching in rails, and but I would like to use this for some in-memory
> caching in my other programs.
>
> I am not able to use it outside rails somehow. require 'memcache' throws, no
> such file to load, when I have the gem in
> "/usr/lib/ruby/gems/1.8/gems/memcache-client-1.3/ and rails is using it
> allright.
>
> The API for memcache also doesn't make it clear, how do I use it in my own
> applications. can anyone clarify on this?
>
> Also, when using CachedModel for activerecord caching..how exactly it works?
> how often will it do read and write to db?
>
> What exactly is meant by "in-process" caching that CacheModel does?
> Also the after_filter stuff that is supposed to flush the local cache in
> rails, I would like to know what is meant by "local cache" stuff and how it
> determines when to flush that content?
>
>
>


 
Reply With Quote
 
 
 
 
Eric Hodel
Guest
Posts: n/a
 
      08-31-2006
On Aug 30, 2006, at 5:26 AM, hemant kumar wrote:

> I am using memcache-client written by beloved eric hodel for
> session
> caching in rails, and but I would like to use this for some in-memory
> caching in my other programs.
>
> I am not able to use it outside rails somehow. require 'memcache'
> throws, no
> such file to load, when I have the gem in
> "/usr/lib/ruby/gems/1.8/gems/memcache-client-1.3/ and rails is
> using it
> allright.


You probably forgot to require 'rubygems'.

> The API for memcache also doesn't make it clear, how do I use it in
> my own
> applications. can anyone clarify on this?


Start with the documentation:

http://dev.robotcoop.com/Libraries/m...ent/index.html

How you use it in your own application depends upon what you want to
cache.

> Also, when using CachedModel for activerecord caching..how exactly
> it works?
> how often will it do read and write to db?


http://dev.robotcoop.com/Libraries/c...del/index.html

CachedModel has write-through behavior.

> What exactly is meant by "in-process" caching that CacheModel does?
> Also the after_filter stuff that is supposed to flush the local
> cache in
> rails, I would like to know what is meant by "local cache" stuff
> and how it
> determines when to flush that content?


The local cache is just a hash. If you don't flush it it will fill
up your memory with ActiveRecord objects. I recommend not using it.

--
Eric Hodel - http://www.velocityreviews.com/forums/(E-Mail Removed) - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with threading.local use in python-memcache module. Sean Reifschneider Python 0 12-17-2010 09:23 PM
[ANN] Ruby-MemCache 0.0.4 Michael Granger Ruby 0 10-14-2005 06:36 AM
Marshal / memcache "can't dump anonymous module" benny Ruby 1 04-25-2005 08:16 PM
[ANN] Ruby-MemCache 0.0.2 Michael Granger Ruby 0 12-02-2004 03:47 PM
[ANN] MemCache 0.0.1 Michael Granger Ruby 0 11-14-2004 09:03 PM



Advertisments