Method: Sequel::ShardedTimedQueueConnectionPool#add_servers

Defined in:
lib/sequel/connection_pool/sharded_timed_queue.rb

#add_servers(servers) ⇒ Object

Adds new servers to the connection pool. Allows for dynamic expansion of the potential replicas/shards at runtime. servers argument should be an array of symbols.

[View source]

43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/sequel/connection_pool/sharded_timed_queue.rb', line 43

def add_servers(servers)
  sync do
    servers.each do |server|
      next if @servers.has_key?(server)

      @servers[server] = server
      @sizes[server] = 0
      @queues[server] = Queue.new
      (@allocated[server] = {}).compare_by_identity
    end
  end
  nil
end