List of usage examples for io.vertx.pgclient PgConnection cancelRequest
PgConnection cancelRequest(Handler<AsyncResult<Void>> handler);
From source file:examples.PgClientExamples.java
License:Apache License
public void cancelRequest(PgConnection connection) { connection.query("SELECT pg_sleep(20)", ar -> { if (ar.succeeded()) { // imagine this is a long query and is still running System.out.println("Query success"); } else {/* w w w .j a v a2 s . c o m*/ // the server will abort the current query after cancelling request System.out.println("Failed to query due to " + ar.cause().getMessage()); } }); connection.cancelRequest(ar -> { if (ar.succeeded()) { System.out.println("Cancelling request has been sent"); } else { System.out.println("Failed to send cancelling request"); } }); }