Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (19 sloc) 587 Bytes
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.{
# 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|
# == 'hello!'
# wait for it to expire and read it again
cache.get('key'){ |val|
# val == nil
puts val