class PG::CancelConnection

def cancel


If the cancellation fails (say, because the server was already done processing the command), then there will be no visible result at all.
If the cancellation is effective, the command being canceled will terminate early and raises an error.
Successful dispatch of the cancellation is no guarantee that the request will have any effect, however.

If the cancel request wasn't successfully dispatched an error message is raised.

Requests that the server abandons processing of the current command in a blocking manner.

conn.cancel
call-seq:
def cancel
	start
	polling_loop(:poll)
end

def initialize(conn)

def initialize(conn)
	c_initialize(conn)
	# A cancel connection is always to one destination server only.
	# Prepare conninfo_hash with just enough information to allow a shared polling_loop.
	@host = conn.host
	@hostaddr = conn.hostaddr
	@port = conn.port
	@conninfo_hash = {
		host: @host,
		hostaddr: @hostaddr,
		port: @port.to_s,
		connect_timeout: conn.conninfo_hash[:connect_timeout],
	}
end