diff --git a/runtime-light/stdlib/job-worker/job-worker-api.cpp b/runtime-light/stdlib/job-worker/job-worker-api.cpp index 2d593f54b..78213eac3 100644 --- a/runtime-light/stdlib/job-worker/job-worker-api.cpp +++ b/runtime-light/stdlib/job-worker/job-worker-api.cpp @@ -84,17 +84,17 @@ task_t kphp_job_worker_start_impl(string request, double timeout, bool // ================================================================================================ -task_t> f$k2_job_worker_start(string request, double timeout) noexcept { +task_t> f$job_worker_send_request(string request, double timeout) noexcept { const auto fork_id{co_await kphp_job_worker_start_impl(std::move(request), timeout, false)}; co_return fork_id != INVALID_FORK_ID ? fork_id : false; } -task_t f$k2_job_worker_start_no_reply(string request, double timeout) noexcept { +task_t f$job_worker_send_noreply_request(string request, double timeout) noexcept { const auto fork_id{co_await kphp_job_worker_start_impl(std::move(request), timeout, true)}; co_return fork_id != INVALID_FORK_ID; } -task_t>> f$k2_job_worker_start_multi(array requests, double timeout) noexcept { +task_t>> f$job_worker_send_multi_request(array requests, double timeout) noexcept { array> fork_ids{requests.size()}; for (const auto &it : requests) { const auto fork_id{co_await kphp_job_worker_start_impl(it.get_value(), timeout, false)}; @@ -105,7 +105,7 @@ task_t>> f$k2_job_worker_start_multi(array reque // ================================================================================================ -task_t f$k2_job_worker_fetch_request() noexcept { +task_t f$job_worker_fetch_request() noexcept { if (!f$is_kphp_job_workers_enabled()) { php_warning("couldn't fetch job worker request: job workers are disabled"); co_return string{}; @@ -119,7 +119,7 @@ task_t f$k2_job_worker_fetch_request() noexcept { co_return std::exchange(jw_server_ctx.body, string{}); } -task_t f$k2_job_worker_store_response(string response) noexcept { +task_t f$job_worker_store_response(string response) noexcept { auto &component_ctx{*get_component_context()}; auto &jw_server_ctx{JobWorkerServerComponentContext::get()}; if (!f$is_kphp_job_workers_enabled()) { // workers are enabled diff --git a/runtime-light/stdlib/job-worker/job-worker-api.h b/runtime-light/stdlib/job-worker/job-worker-api.h index 839cb001e..f9c36a333 100644 --- a/runtime-light/stdlib/job-worker/job-worker-api.h +++ b/runtime-light/stdlib/job-worker/job-worker-api.h @@ -13,17 +13,17 @@ // === Client ===================================================================================== -task_t> f$k2_job_worker_start(string request, double timeout) noexcept; +task_t> f$job_worker_send_request(string request, double timeout) noexcept; -task_t f$k2_job_worker_start_no_reply(string request, double timeout) noexcept; +task_t f$job_worker_send_noreply_request(string request, double timeout) noexcept; -task_t>> f$k2_job_worker_start_multi(array requests, double timeout) noexcept; +task_t>> f$job_worker_send_multi_request(array requests, double timeout) noexcept; // === Server ===================================================================================== -task_t f$k2_job_worker_fetch_request() noexcept; +task_t f$job_worker_fetch_request() noexcept; -task_t f$k2_job_worker_store_response(string response) noexcept; +task_t f$job_worker_store_response(string response) noexcept; // === Misc ======================================================================================= diff --git a/runtime-light/stdlib/rpc/rpc-api.cpp b/runtime-light/stdlib/rpc/rpc-api.cpp index 5b7d561a6..ef7246a30 100644 --- a/runtime-light/stdlib/rpc/rpc-api.cpp +++ b/runtime-light/stdlib/rpc/rpc-api.cpp @@ -358,7 +358,7 @@ string f$fetch_string() noexcept { // === Rpc Query ================================================================================== -task_t> f$k2_kphp_rpc_tl_query(string actor, array tl_objects, double timeout, bool ignore_answer, +task_t> f$rpc_send_request(string actor, array tl_objects, double timeout, bool ignore_answer, class_instance requests_extra_info, bool need_responses_extra_info) noexcept { if (ignore_answer && need_responses_extra_info) { php_warning("Both $ignore_answer and $need_responses_extra_info are 'true'. Can't collect metrics for ignored answers"); @@ -380,7 +380,7 @@ task_t> f$k2_kphp_rpc_tl_query(string actor, array tl_obje co_return query_ids; } -task_t>> f$k2_kphp_rpc_tl_query_result(array query_ids) noexcept { +task_t>> f$rpc_fetch_response(array query_ids) noexcept { array> res{query_ids.size()}; for (const auto &it : query_ids) { res.set_value(it.get_key(), co_await rpc_impl_::rpc_tl_query_result_one_impl(it.get_value())); diff --git a/runtime-light/stdlib/rpc/rpc-api.h b/runtime-light/stdlib/rpc/rpc-api.h index 3cd4869bf..b3c70f954 100644 --- a/runtime-light/stdlib/rpc/rpc-api.h +++ b/runtime-light/stdlib/rpc/rpc-api.h @@ -59,11 +59,11 @@ string f$fetch_string() noexcept; // === Rpc Query ================================================================================== - task_t> f$k2_kphp_rpc_tl_query(string actor, array tl_objects, double timeout = -1.0, bool ignore_answer = false, + task_t> f$rpc_send_request(string actor, array tl_objects, double timeout = -1.0, bool ignore_answer = false, class_instance requests_extra_info = {}, bool need_responses_extra_info = false) noexcept; template rpc_function_t, std::same_as rpc_request_t = KphpRpcRequest> -task_t> f$k2_kphp_typed_rpc_tl_query(string actor, array> query_functions, double timeout = -1.0, +task_t> f$rpc_send_typed_query_request(string actor, array> query_functions, double timeout = -1.0, bool ignore_answer = false, class_instance requests_extra_info = {}, bool need_responses_extra_info = false) noexcept { if (ignore_answer && need_responses_extra_info) { @@ -87,11 +87,11 @@ task_t> f$k2_kphp_typed_rpc_tl_query(string actor, array>> f$k2_kphp_rpc_tl_query_result(array query_ids) noexcept; +task_t>> f$rpc_fetch_response(array query_ids) noexcept; template query_id_t = int64_t, std::same_as error_factory_t = RpcResponseErrorFactory> requires std::default_initializable task_t>> -f$k2_kphp_typed_rpc_tl_query_result(array query_ids) noexcept { +f$rpc_fetch_typed_response(array query_ids) noexcept { array> res{query_ids.size()}; for (const auto &it : query_ids) { res.set_value(it.get_key(), co_await rpc_impl_::typed_rpc_tl_query_result_one_impl(it.get_value(), error_factory_t{}));