This class represents a memcached server instance.
| Constants |
| CONNECT_TIMEOUT |
The amount of time to wait to establish a connection with a memcached
server. If a connection cannot be established within this time limit, the
server will be marked as down.
|
| RETRY_DELAY |
The amount of time to wait before attempting to re-establish a connection
with a server that is marked dead.
|
| Public Attributes |
| host |
The host the memcached server is running on.
|
| port |
The port the memcached server is listening on.
|
| retry |
The time of next retry if the connection is dead.
|
| status |
A text status string describing the state of the server.
|
| weight |
The weight given to the server.
|
| Public Methods |
| alive? |
Check whether the server connection is alive. This will cause the socket to
attempt to connect if it isn’t already connected and or if the server
was previously marked as down and the retry time has been exceeded.
|
| close |
Close the connection to the memcached server targeted by this object. The
server is not considered dead.
|
| inspect |
Return a string representation of the server object.
|
| new |
Create a new MemCache::Server object for the memcached instance listening
on the given host and port, weighted by the given weight.
|
| socket |
Try to connect to the memcached server targeted by this object. Returns the
connected socket object on success or nil on failure.
|
| Private Methods |
| mark_dead |
Mark the server as dead and close its socket.
|
<code/>and<pre/>for code samples.