Class: Memcached

Inherits:
Object
  • Object
show all
Defined in:
lib/active_support/cache/libmemcached_store.rb

Instance Method Summary collapse

Instance Method Details

#set_servers(servers) ⇒ Object

The latest version of memcached (0.11) doesn't support hostnames with dashes in their names, so we overwrite it here to be more lenient.



6
7
8
9
10
11
# File 'lib/active_support/cache/libmemcached_store.rb', line 6

def set_servers(servers)
  [*servers].each_with_index do |server, index|
    host, port = server.split(":")
    Lib.memcached_server_add(@struct, host, port.to_i)
  end
end