class method
self.new
Ruby on Rails 2.2.3
Since v2.2.3 Last seen in v2.3.18Available in: v2.2.3 v2.3.18
Signature
self.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.
Parameters
-
memcachereq -
hostreq -
portopt = DEFAULT_PORT -
weightopt = DEFAULT_WEIGHT
Source
# File activesupport/lib/active_support/vendor/memcache-client-1.5.1/memcache.rb, line 749
def initialize(memcache, host, port = DEFAULT_PORT, weight = DEFAULT_WEIGHT)
raise ArgumentError, "No host specified" if host.nil? or host.empty?
raise ArgumentError, "No port specified" if port.nil? or port.to_i.zero?
@memcache = memcache
@host = host
@port = port.to_i
@weight = weight.to_i
@multithread = @memcache.multithread
@mutex = Mutex.new
@sock = nil
@retry = nil
@status = 'NOT CONNECTED'
end
Defined in activesupport/lib/active_support/vendor/memcache-client-1.5.1/memcache.rb line 749
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in MemCache::Server