Skip to content

Commit e99c0b7

Browse files
committed
doc: Document clientInvoke/serverInvoke functions
Show how they are invoked by generated code
1 parent 2098ae1 commit e99c0b7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

include/mp/proxy-types.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,6 +1450,15 @@ void serverDestroy(Server& server)
14501450
server.m_context.connection->m_loop.log() << "IPC server destroy" << typeid(server).name();
14511451
}
14521452

1453+
//! Entry point called by generated client code that looks like:
1454+
//!
1455+
//! ProxyClient<ClassName>::M0::Result ProxyClient<ClassName>::methodName(M0::Param<0> arg0, M0::Param<1> arg1) {
1456+
//! typename M0::Result result;
1457+
//! clientInvoke(*this, &InterfaceName::Client::methodNameRequest, MakeClientParam<...>(arg0), MakeClientParam<...>(arg1), MakeClientParam<...>(result));
1458+
//! return result;
1459+
//! }
1460+
//!
1461+
//! Ellipses above are where generated Accessor<> type declarations are inserted.
14531462
template <typename ProxyClient, typename GetRequest, typename... FieldObjs>
14541463
void clientInvoke(ProxyClient& proxy_client, const GetRequest& get_request, FieldObjs&&... fields)
14551464
{
@@ -1538,6 +1547,13 @@ auto ReplaceVoid(Fn&& fn, Ret&& ret) ->
15381547

15391548
extern std::atomic<int> server_reqs;
15401549

1550+
//! Entry point called by generated server code that looks like:
1551+
//!
1552+
//! kj::Promise<void> ProxyServer<InterfaceName>::methodName(CallContext call_context) {
1553+
//! return serverInvoke(*this, call_context, MakeServerField<0, ...>(MakeServerField<1, ...>(Make<ServerRet, ...>(ServerCall()))));
1554+
//! }
1555+
//!
1556+
//! Ellipses above are where generated Accessor<> type declarations are inserted.
15411557
template <typename Server, typename CallContext, typename Fn>
15421558
kj::Promise<void> serverInvoke(Server& server, CallContext& call_context, Fn fn)
15431559
{

0 commit comments

Comments
 (0)