pub async fn cancel(
        host: &str,
        port: &str,
        process_id: i32,
        secret_key: i32,
    ) -> Result<(), Error> {
        let mut stream = match TcpStream::connect(&format!("{}:{}", host, port)).await {
            Ok(stream) => stream,
            Err(err) => {
                error!("Could not connect to server: {}", err);
                return Err(Error::SocketError);
            }
        };

        debug!("Sending CancelRequest");

        let mut bytes = BytesMut::with_capacity(16);
        bytes.put_i32(16);
        bytes.put_i32(CANCEL_REQUEST_CODE);
        bytes.put_i32(process_id);
        bytes.put_i32(secret_key);

        Ok(write_all(&mut stream, bytes).await?)
    }
/// Issue a query cancellation request to the server.
/// Uses a separate connection that's not part of the connection pool.
Issue a query cancellation request to the server.
Uses a separate connection that's not part of the connection pool.
Issue a query cancellation request to the server . Uses a separate connection that ' s not part of the connection pool .
pub async fn cancel(
        host: &str,
        port: &str,
        process_id: i32,
        secret_key: i32,
    ) -> Result<(), Error> {
        let mut stream = match TcpStream::connect(&format!("{}:{}", host, port)).await {
            Ok(stream) => stream,
            Err(err) => {
                error!("Could not connect to server: {}", err);
                return Err(Error::SocketError);
            }
        };
        debug!("Sending CancelRequest");
        let mut bytes = BytesMut::with_capacity(16);
        bytes.put_i32(16);
        bytes.put_i32(CANCEL_REQUEST_CODE);
        bytes.put_i32(process_id);
        bytes.put_i32(secret_key);
        Ok(write_all(&mut stream, bytes).await?)
    }
pub async fn cancel ( host : & str , port : & str , process_id : i32 , secret_key : i32 , ) -> Result < ( ) , Error > { let mut stream = match TcpStream :: connect ( & format ! ( " " host port ) ) . await { Ok ( stream ) => stream , Err ( err ) => { error ! ( " " err ) ; return Err ( Error :: SocketError ) ; } } ; debug ! ( " " ) ; let mut bytes = BytesMut :: with_capacity ( 16 ) ; bytes . put_i32 ( 16 ) ; bytes . put_i32 ( CANCEL_REQUEST_CODE ) ; bytes . put_i32 ( process_id ) ; bytes . put_i32 ( secret_key ) ; Ok ( write_all ( & mut stream , bytes ) . await ? ) }
Issue a query cancellation request to the server.
Issue a query cancellation request to the server .
host
&str
port
&str
process_id
i32
secret_key
i32
host
&str
port
&str
process_id
i32
secret_key
i32