Class | MemCache::Server
In: | lib/active_support/vendor/memcache-client-1.6.5/memcache.rb
Parent: | Object

This class represents a memcached server instance.

### Methods

alive? close inspect mark_dead new socket

### Constants

CONNECT_TIMEOUT | = | 0.25 |  | 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 | = | 30.0 |  | The amount of time to wait before attempting to re-establish a connection with a server that is marked dead.

### Attributes

host | [R] | The host the memcached server is running on.
logger | [R] |
port | [R] | The port the memcached server is listening on.
retry | [R] | The time of next retry if the connection is dead.
status | [R] | A text status string describing the state of the server.
weight | [R] | The weight given to the server.

### Public Class methods

new(memcache, host, port = DEFAULT_PORT, weight = DEFAULT_WEIGHT)

Create a new MemCache::Server object for the memcached instance listening on the given host and port, weighted by the given weight.

### Public Instance 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.

mark_dead(error)

Mark the server as dead and close its socket.

socket()

Try to connect to the memcached server targeted by this object. Returns the connected socket object on success or nil on failure.

[Validate]