isapego commented on code in PR #5532:
URL: https://github.com/apache/ignite-3/pull/5532#discussion_r2022817067


##########
modules/platforms/cpp/ignite/client/detail/sql/sql_impl.cpp:
##########
@@ -88,8 +89,28 @@ void write_args(protocol::writer &writer, const 
std::vector<primitive> &args) {
     writer.write_binary(args_data);
 }
 
-void sql_impl::execute_async(transaction *tx, const sql_statement &statement, 
std::vector<primitive> &&args,
-    ignite_callback<result_set> &&callback) {
+void add_action(cancellation_token &token, node_connection &connection, 
std::int64_t req_id) {
+    auto writer_func = [req_id](protocol::writer &writer) {
+        writer.write(req_id);
+    };
+
+    cancellation_token_impl &token_impl = 
static_cast<cancellation_token_impl&>(token);
+    token_impl.add_action(connection.get_logger(), [req_id, &connection, 
writer_func] (ignite_callback<void> callback) {
+        
connection.perform_request<void>(protocol::client_operation::SQL_CANCEL_EXEC,
+            writer_func, [] (protocol::reader&){}, std::move(callback));
+    });

Review Comment:
   You actually right, I should pass `shared_ptr` here. Fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to