File: README.rdoc

package info (click to toggle)
ruby-memcache-client 1.8.5-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 264 kB
  • ctags: 298
  • sloc: ruby: 2,120; makefile: 8
file content (67 lines) | stat: -rw-r--r-- 1,856 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
= memcache-client

A ruby library for accessing memcached.

Source:

http://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::        mailto:mperham@gmail.com
Twitter::      mperham[http://twitter.com/mperham]
WWW::          http://mikeperham.com

If my work on memcache-client is something you support, please take a moment to
recommend me at WWR[http://workingwithrails.com/person/10797-mike-perham].  I'm not
asking for money, just a electronic "thumbs up".