public
Description: A memcache client implementation that uses eventmachine
Homepage:
Clone URL: git://github.com/cliffmoon/eventedcache.git
tmm1 (author)
Thu Feb 12 14:34:42 -0800 2009
cliffmoon (committer)
Sun Feb 22 14:58:27 -0800 2009
name age message
file .gitignore Sat Jan 10 21:25:35 -0800 2009 added conftest dir to ignore [cliffmoon]
file README Loading commit data...
file Rakefile Sat Jan 10 21:25:57 -0800 2009 rake tasks [cliffmoon]
directory ext/
directory fixtures/ Sat Jan 10 20:37:17 -0800 2009 first draft of the memcache parser. supports v... [cliffmoon]
directory lib/
directory spec/
directory tasks/ Sat Jan 10 21:25:57 -0800 2009 rake tasks [cliffmoon]
README
EventedCache is an eventmachine based memcache client.  It should be ultrafast and scalable since it leverages the power 
of ragel to parse memcache protocol and the scalability of eventmachine.

EM.run{

  # connect to memcached
  cache = EventedCache.connect('localhost', 11211)

  # set a value that expires in 1 second
  cache.set('key', 'hello!', 1)

  # read the value
  cache.get('key'){ |val|
    # val.data == 'hello!'
    puts val.data
  }

  # wait for it to expire and read it again
  EM.add_timer(2){
    cache.get('key'){ |val|
      # val == nil
      puts val
    }
  }

}