Method: Sequel::ShardedSingleConnectionPool#disconnect

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

#disconnect(opts = OPTS) ⇒ Object

Disconnects from the database. Once a connection is requested using #hold, the connection is reestablished. Options:

:server

Should be a symbol specifing the server to disconnect from, or an array of symbols to specify multiple servers.



43
44
45
46
47
48
# File 'lib/sequel/connection_pool/sharded_single.rb', line 43

def disconnect(opts=OPTS)
  (opts[:server] ? Array(opts[:server]) : servers).each do |s|
    raise Sequel::Error, "invalid server: #{s}" unless @servers.has_key?(s)
    disconnect_server(s)
  end
end