brpc stream模式是否支持发送“完成”标记?
Open
feature
- Dominant language
- C++
- Stars
- 17.6k
- Forks
- 4.1k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 69
Description
深入阅读了brpc stream的源码,有以下问题
场景:
client用stream方式向server发一个文件,当全部包都发过去后,server回复client一个确认
那么server怎么知道client发完包了呢?似乎必须在用户逻辑中完成,比如client发完包后,再发送一个“End”字符串,Server在读取到“End”后,就可以回复“”Ok“。框架没有提供这样的的api。
本来以为StreamClose是干这个的,结果发现调用了Close后,流就没法用了。。。。
grpc就友好很多,双向流模式调用WriteDone后流还在,对方还能继续发消息。
Contributor guide
Research direction
Start by reading the brpc stream source around StreamClose and the existing client/server stream lifecycle. Compare the requested end-of-sending behavior with the current user-level “End” message and the gRPC WriteDone behavior; done should be a clearly defined API that lets the server detect completion while preserving the stream for the remaining direction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- api, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100