Docunext


Ruby Memcached

October 31st, 2009

I'm trying out memcachedb and since it uses the same protocol as memcached, I figured I'd use Ruby's memcached library to access it.

dev-48-gl:~$ irb
irb(main):001:0> require 'memcache'
=> true
irb(main):002:0> CACHE = MemCache.new 'localhost:21201', :namespace => 'my_namespace'
=> 
irb(main):003:0> CACHE[:blah] = "barf"
=> "barf"
irb(main):004:0> puts CACHE[:blah]
barf
=> nil
irb(main):005:0>

Works like a charm!

Yearly Indexes: 2003 2004 2006 2007 2008 2009 2010 2011 2012 2013 2015 2019 2020 2022