-
Notifications
You must be signed in to change notification settings - Fork 310
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
https://alibaba.github.io/yalantinglibs/zh/coro_rpc/coro_rpc_introduction.html
#include "rpc_service.hpp"
#include <ylt/coro_rpc/coro_rpc_client.hpp>
using namespace coro_rpc;
using namespace async_simple::coro;
Lazy test_client() {
coro_rpc_client client;
co_await client.connect("localhost", /port =/"9000");
auto r = co_await client.call("hello coro_rpc"); //传参数调用rpc函数
std::cout << r.result.value() << "\n"; //will print "hello coro_rpc"
}
int main() {
syncAwait(test_client());
}
错误行
std::cout << r.result.value() << "\n"; //will print "hello coro_rpc"
r.result.value()改为r.value()后可以运行
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation