Out of my Mind...

Random Thoughts From My Sleep Deprived Mind.

    • Edit
    • Delete
    • Autopost

    JRuby MemCache Client Gem

    I wrote a post about using the jruby_memcache_client Rails plugin to manage sessions. Since then, Abhi Yerra made a fork of Ikai Lan's repository and turned it into a gem. I promptly merged his changes into my repository and I am now publishing my own version of the gem (with a few minor changes).

    The new JRuby MemCache Client Gem is API compatible with the Ruby MemCache Client. You should now be able to install the gem into your application and use it directly.

    Installing The Gem

    You need to add github as a source for gems before you can install the new gem. Thsi is a simple one time command to run:

    gem sources -a http://gems.github.com The next step is to install the gem as usual:
    jruby -S gem install fredjean-jruby-memcache-client --remote Using the JRuby MemCache Client Gem One way to use the JRuby MemCache Client is to add the following to your environment.rb:
    memcache_options = {
    :namespace => 'fortaleza:production_live:'
    }
    memcached_servers = [ ENV['MEMCACHED_LOCATION'] || '127.0.0.1:11211']
    
    # Constant used by libs
    CACHE = MemCache.new memcached_servers, memcache_options
    You will then be able to configure Rails to use the :mem_cache_store for both session and cache store.
    • 6 May 2009
    • Views
    • 0 Comments
    • Permalink
    • Favorited 0 Times
    • Tweet

    Comments 0 Comments

    Leave a Comment

  • Frederic Jean's Posterous

    New father of twins, still catching up on sleep deprivation.

    Aspiring software craftsman with a deep interest in using alternative language on the Java Virtual Machine to simplify and speed up software development.

  • About Frederic Jean

    New father of twins, still catching up on sleep deprivation.

    Aspiring software craftsman with a deep interest in using alternative language on the Java Virtual Machine to simplify and speed up software development.

  • Subscribe

    Subscribe to this posterous
    Unsubscribe
    Follow this posterous RSS
  • Follow Me

Theme created for Posterous by Obox