apache / brpc

brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".
https://brpc.apache.org
Apache License 2.0
16.56k stars 3.98k forks source link

baidu_rpc协议能否一次RPC调用创建多个Stream #2733

Closed jenrryyou closed 1 month ago

jenrryyou commented 3 months ago

我们的场景需要创建比较多的Stream,为了提升性能和稳定性,想给baidu_rpc 增加一次RPC批量创建多个stream的能力,目前的想法是StreamCreate,StreamAccept都支持传入StreamIds,同时Controller里_request_stream和_response_stream也都改成数组。其他的接口保持不变,streaming_rpc_meta.proto里会增加一个批量的StreamSettings,协议保持兼容(新旧版本可以共用)。最近准备开发了,想问下社区有什么建议吗?

chenBright commented 3 months ago

新服务端不知道客户端是怎么建流的,所以只能用批量的StreamAccept了吧?

jenrryyou commented 3 months ago

对,按传过来的StreamIds的顺序批量accept,返回streamID顺序也会传入的StreamID对应

jiushun commented 2 months ago

如何在rpc的实现方法里,等待 stream 关闭后再返回response呢