instance method create_continuum_for

Ruby on Rails 2.3.18

Since v2.3.18 Last seen in v2.3.18

Signature

create_continuum_for(servers)

No documentation comment.

Parameters

servers req
Source
# File activesupport/lib/active_support/vendor/memcache-client-1.7.4/memcache.rb, line 872
  def create_continuum_for(servers)
    total_weight = servers.inject(0) { |memo, srv| memo + srv.weight }
    continuum = []

    servers.each do |server|
      entry_count_for(server, servers.size, total_weight).times do |idx|
        hash = Digest::SHA1.hexdigest("#{server.host}:#{server.port}:#{idx}")
        value = Integer("0x#{hash[0..7]}")
        continuum << Continuum::Entry.new(value, server)
      end
    end

    continuum.sort { |a, b| a.value <=> b.value }
  end

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

Defined in MemCache

Type at least 2 characters to search.

↑↓ navigate · open · esc close