RFoe / coasync

Asynchronous network library that supports coroutines in C++20
https://github.com/RFoe/coasync
MIT License
18 stars 3 forks source link

rpc客户端/服务端加入流式调用 #7

Open RFoe opened 4 weeks ago

RFoe commented 4 weeks ago

https://github.com/RFoe/coasync/blob/2e9135c972c0afac9603014353893510dda94186/include/coasync/net/rpc/rpc_client.hpp#L18-L20

或许是这样

net::serde_stream reply = client.call_streaming("get_bytes", 5);
for(unsigned int i {}; i < 5; i ++) {
    std::printf("%c\n", co_await reply.get<char>());
}