Git Product home page Git Product logo

memcache-client's Introduction

memcache-client

A ruby library for accessing memcached.

memcache-client is deprecated as of August 2010. It will be supported through 2010 but new code should use Dalli instead.

Source:

github.com/mperham/memcache-client

Installing memcache-client

Just install the gem:

$ sudo gem install memcache-client

Using memcache-client

With one server:

CACHE = MemCache.new 'localhost:11211'

Or with multiple servers:

CACHE = MemCache.new %w[one.example.com:11211 two.example.com:11211]

Tuning memcache-client

The MemCache.new method takes a number of options which can be useful at times. Please read the source comments there for an overview. If you are using Ruby 1.8.x and using multiple memcached servers, you should install the RubyInline gem for ultimate performance.

Using memcache-client with Rails

Rails 2.1+ includes memcache-client 1.5.0 out of the box. See ActiveSupport::Cache::MemCacheStore and the Rails.cache method for more details. Rails 2.3+ will use the latest memcache-client gem installed.

Using memcache-client with EventMachine

memcache-client 1.8.0 added support for native EventMachine connections using Ruby 1.9. If you are using an EventMachine-based application (e.g. thin), you can activate the EventMachine support like so:

require 'memcache'
require 'memcache/event_machine'

EM.run do
  Fiber.new do
    m = MemCache.new('localhost:11211')
    m.set 'abc', 'xyz'
    m.get 'abc'
  end.resume
end

Questions?

memcache-client is maintained by Mike Perham and was originally written by Bob Cottrell, Eric Hodel and the seattle.rb crew.

Email

[email protected]

Twitter

mperham

WWW

mikeperham.com

If my work on memcache-client is something you support, please take a moment to recommend me at WWR. I’m not asking for money, just a electronic “thumbs up”.

memcache-client's People

Contributors

djanowski avatar iamaleksey avatar josh avatar jsierles2 avatar jsl avatar mperham avatar natacado avatar ninjudd avatar packagethief avatar radicaled avatar rajiv avatar sd avatar tenderlove avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.