A Ruby client library for memcached.
This is intended to provide access to basic memcached functionality. It
does not attempt to be complete implementation of the entire API, but it is
approaching a complete implementation.
| Public Attributes |
| multithread |
The multithread setting for this instance
|
| namespace |
The namespace for this instance
|
| request_timeout |
The amount of time to wait for a response from a memcached server. If a
response is not completed within this time, the connection to the server
will be closed and an error will be raised.
|
| servers |
The servers this client talks to. Play at your own peril.
|
| Public Methods |
| [] |
Alias for #get
|
| []= |
Shortcut to save a value in the cache. This method does not set an
expiration on the entry. Use set to specify an explicit expiry.
|
| active? |
Returns whether there is at least one active server for the object.
|
| add |
Add key to the cache with value value that expires in
expiry seconds, but only if key does not already exist in
the cache. If raw is true, value will not be Marshalled.
|
| decr |
Deceremets the value for key by amount and returns the
new value. key must already exist. If key is not an
integer, it is assumed to be
|
| delete |
Removes key from the cache in expiry seconds.
|
| flush_all |
Flush the cache from all memcache servers.
|
| get |
Retrieves key from memcache. If raw is false, the value
will be unmarshalled.
|
| get_multi |
Retrieves multiple values from memcached in parallel, if possible.
|
| incr |
Increments the value for key by amount and retruns the
new value. key must already exist. If key is not an
integer, it is assumed to be 0.
|
| inspect |
Returns a string representation of the cache object.
|
| new |
Accepts a list of servers and a list of opts.
servers may be omitted. See +servers=+ for acceptable server list
arguments.
|
| readonly? |
Returns whether or not the cache object was created read only.
|
| reset |
Reset the connection to all memcache servers. This should be called if
there is a problem with a cache lookup that might have left the connection
in a corrupted state.
|
| servers= |
Set the servers that the requests will be distributed between. Entries can
be either strings of the form "hostname:port" or
"hostname:port:weight" or MemCache::Server objects.
|
| set |
Add key to the cache with value value that expires in
expiry seconds. If raw is true, value will not
be Marshalled.
|
| stats |
Returns statistics for each memcached server. An explanation of the
statistics can be found in the memcached docs:
|
<code/>and<pre/>for code samples.