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


##########
modules/platforms/cpp/ignite/client/detail/compute/compute_impl.cpp:
##########
@@ -148,24 +291,59 @@ void compute_impl::submit_colocated(const std::string 
&table_name, const ignite_
                     write_primitives_as_binary_tuple(writer, args);
                 };
 
-                auto response_reader_func = [](protocol::reader &reader) {
-                    (void) reader.read_int32(); // Skip schema version.
-                };
-
-                auto notification_reader_func = [](protocol::reader &reader) 
-> std::optional<primitive> {
-                    if (reader.try_read_nil())
-                        return std::nullopt;
-
-                    return read_primitive_from_binary_tuple(reader);
-                };
+                auto handler = 
std::make_shared<response_handler_compute>(self, std::move(callback), true);
 
-                
conn->perform_request_single_notification<std::optional<primitive>>(
-                    protocol::client_operation::COMPUTE_EXECUTE_COLOCATED, 
writer_func, std::move(response_reader_func),
-                    std::move(notification_reader_func), std::move(callback));
+                conn->perform_request_handler(
+                    protocol::client_operation::COMPUTE_EXECUTE_COLOCATED, 
nullptr, writer_func, std::move(handler));
             });
     };
 
     m_tables->get_table_async(table_name, std::move(on_table_get));
 }
 
+void compute_impl::get_status_async(uuid id, 
ignite_callback<std::optional<job_status>> callback) {
+    auto writer_func = [id](protocol::writer &writer) { writer.write(id); };
+
+    auto reader_func = [](protocol::reader &reader) -> 
std::optional<job_status> {
+        return read_job_status_opt(reader);
+    };
+
+    m_connection->perform_request<std::optional<job_status>>(
+        protocol::client_operation::COMPUTE_GET_STATUS, writer_func, 
std::move(reader_func), std::move(callback));

Review Comment:
   `writer_func` here is passed as a reference, because it's always called 
before we interrupt execution.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to