Skip to content

coro_rpc简介 示例代码错误 #1082

@AHzhangwen

Description

@AHzhangwen

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()后可以运行

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions