class method self.new

Ruby on Rails 2.3.18

Since v2.2.3 Last seen in v2.3.18

Available 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

memcache req
host req
port opt = DEFAULT_PORT
weight opt = DEFAULT_WEIGHT
Source
# File activesupport/lib/active_support/vendor/memcache-client-1.7.4/memcache.rb, line 945
    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?

      @host   = host
      @port   = port.to_i
      @weight = weight.to_i

      @sock   = nil
      @retry  = nil
      @status = 'NOT CONNECTED'
      @timeout = memcache.timeout
      @logger = memcache.logger
    end

Defined in activesupport/lib/active_support/vendor/memcache-client-1.7.4/memcache.rb line 945 · View on GitHub · Improve this page · Find usages on GitHub

Defined in MemCache::Server

Type at least 2 characters to search.

↑↓ navigate · open · esc close