Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A memcache client implementation that uses eventmachine

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 ext
Octocat-spinner-32 fixtures
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 tasks
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
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
    }
  }

}
Something went wrong with that request. Please try again.