module PG::Connection::Pollable
def remove_current_host(iopts)
- :port
- :hostaddr
- :host
Affected options are:
Remove the host to which the connection is currently established from the option hash.
def remove_current_host(iopts) = iopts[:host]&.split(",", -1) drs = iopts[:hostaddr]&.split(",", -1) = iopts[:port]&.split(",", -1) = iports * (ihosts || ihostaddrs || [1]).size if iports&.size == 1 ihosts || ihostaddrs || iports).index.with_index do |_, i| s ? ihosts[i] == host : true) && addrs && respond_to?(:hostaddr, true) ? ihostaddrs[i] == hostaddr : true) && s ? iports[i].to_i == port : true) &.delete_at(idx) ddrs&.delete_at(idx) &.delete_at(idx) merge!( ihosts.join(",")) if ihosts merge!( ddr: ihostaddrs.join(",")) if ihostaddrs merge!( iports.join(",")) if iports || ihostaddrs || iports).size