Skip to content

Commit 5578781

Browse files
committed
docs(kitex): clarify distinction between Unary and Ping Pong modes in streaming documentation
1 parent 52b66d6 commit 5578781

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

content/en/docs/kitex/Tutorials/advanced-feature/generic-call/generic_streaming.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ service Echo {
4242

4343
The four methods included in the example IDL correspond to four scenarios:
4444

45-
1. Client streaming: the client sends multiple messages, the server returns one message, and then closes the stream.
46-
2. Server streaming: The client sends one message, the server returns multiple messages, and then closes the stream. It's suitable for LLM scenarios.
47-
3. Bidirectional streaming: The sending and receiving of client/server are independent, which can be organized in arbitrary order.
48-
4. Unary: non streaming.
45+
1. Client Streaming: the client sends multiple messages, the server returns one message, and then closes the stream.
46+
2. Server Streaming: The client sends one message, the server returns multiple messages, and then closes the stream. It's suitable for LLM scenarios.
47+
3. Bidirectional Streaming: The sending and receiving of client/server are independent, which can be organized in arbitrary order.
48+
4. Unary: In gRPC, this is a single call mode without using streams, similar to the Ping Pong mode in Thrift.
4949

5050
First of all, please initialize the streaming client. Here is an example of streaming client initialization.
5151

@@ -100,11 +100,11 @@ service TestService {
100100

101101
The four methods included in the example IDL correspond to four scenarios:
102102

103-
1. Client streaming: the client sends multiple messages, the server returns one message, and then closes the stream.
104-
2. Server streaming: The client sends one message, the server returns multiple messages, and then closes the stream. It's suitable for LLM scenarios.
105-
3. Bidirectional streaming: The sending and receiving of client/server are independent, which can be organized in arbitrary order.
106-
4. Unary (gRPC): Non-streaming. With `streaming.mode` annotation. Not recommended due to performance loss.
107-
5. Unary (KitexThrift): Non-streaming. Recommended.
103+
1. Client Streaming: the client sends multiple messages, the server returns one message, and then closes the stream.
104+
2. Server Streaming: The client sends one message, the server returns multiple messages, and then closes the stream. It's suitable for LLM scenarios.
105+
3. Bidirectional Streaming: The sending and receiving of client/server are independent, which can be organized in arbitrary order.
106+
4. Unary (gRPC): Non-streaming with `streaming.mode` annotation. Not recommended due to performance loss.
107+
5. Ping Pong mode (KitexThrift): Traditional Thrift request-response pattern without using streams. Better performance, recommended.
108108

109109
Here is an example of streaming client initialization.
110110

content/zh/docs/kitex/Tutorials/advanced-feature/generic-call/generic_streaming.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ service StreamingService {
4444
1. Client Streaming:客户端发送多条消息,服务端返回一条消息后关闭流。
4545
2. Server Streaming:客户端发送一条消息,服务端返回多条消息后关闭流,适合大模型等场景。
4646
3. Bidirectional Streaming:客户端和服务端可独立收发消息,顺序可自定义。
47-
4. Unary:单次调用(非流式)
47+
4. Unary:gRPC 中的单次调用模式,不使用流机制,类似于 Thrift 中的 Ping Pong 模式
4848

4949
流式客户端初始化示例:
5050

@@ -112,7 +112,7 @@ service TestService {
112112
2. 服务端流:客户端发送一条消息,服务端返回多条消息后关闭流,适合大模型等场景。
113113
3. 双向流:客户端和服务端可独立收发消息,顺序可自定义。
114114
4. 单次调用(gRPC):带 `streaming.mode` 注解的非流式(不推荐,性能有损失)。
115-
5. 单次调用(KitexThrift):非流式(推荐)
115+
5. Ping Pong 模式(KitexThrift):传统的 Thrift 一发一收模式,不使用流机制,性能更好,推荐使用
116116

117117
流式客户端初始化示例:
118118

0 commit comments

Comments
 (0)