feat(rpc_loader): Add async support for RPC function calls#623
Open
Mag-D-Anas wants to merge 1 commit intometacall:developfrom
Open
feat(rpc_loader): Add async support for RPC function calls#623Mag-D-Anas wants to merge 1 commit intometacall:developfrom
Mag-D-Anas wants to merge 1 commit intometacall:developfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(rpc_loader): Add async support for RPC function calls
Summary
This PR implements the previously unimplemented function_rpc_interface_await function in the RPC loader, enabling non-blocking asynchronous remote procedure calls. This is a foundational step towards the Function Mesh concept - allowing applications to be split across multiple servers while maintaining transparent function call semantics.
Motivation
The RPC loader previously only supported synchronous function calls, which block the calling thread until the remote server responds. For long-running remote operations, this creates performance bottlenecks. Async support enables:
Changes
source/loaders/rpc_loader/source/rpc_loader_impl.cpp
std::threadfor async HTTP calls#include <thread>for threading support/await/{function_name}resolve_callbackon success orreject_callbackon failuresource/tests/metacall_rpc_test/source/server.js
async_dividefunction with"async": truein inspect response/await/async_dividePOST endpoint handlerThreading Strategy: Uses
std::threadwith detached threads. Each async call:Testing
/call/(sync) and/await/(async) endpointsFuture Considerations
Related