Skip to content

Commit 3f5d5a6

Browse files
committed
docs: add streamx timeout control and update some description
1 parent cffeb76 commit 3f5d5a6

File tree

5 files changed

+87
-20
lines changed

5 files changed

+87
-20
lines changed

content/en/blog/releases/Kitex/release-v0_13_0.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ date: 2025-04-07
66
description: >
77
---
88

9-
> We recommend upgrading directly to Kitex version v0.13.1, as we have fixed a potential Goroutine leak issue in the gRPC Client in v0.13.0.
9+
> We recommend upgrading directly to Kitex version v0.13.1, as we have fixed a potential Goroutine leak issue of the gRPC Client in v0.13.0.
1010
1111
## **Introduction to Key Changes**
1212

1313
### **New Features**
14-
1. New streaming interface StreamX supports gRPC, stock Kitex gRPC users can migrate
15-
v0.12.0 released the StreamX interface to optimise the streaming experience, and supported the custom streaming protocol TTHeader Streaming, but did not support gRPC. So stock users could not migrate.
14+
1. New streaming interface StreamX supports gRPC, existing Kitex gRPC users can migrate
15+
v0.12.0 released the StreamX interface to optimise the streaming experience, and supported the custom streaming protocol TTHeader Streaming, but did not support gRPC. So existing users could not migrate.
1616

1717
This version supports gRPC for StreamX, users can migrate to StreamX, and the Server side can be compatible with two streaming protocols at the same time. So there is no need to worry about protocol compatibility after interface migration.
1818

@@ -21,7 +21,7 @@ description: >
2121
User documentation: [StreamX User Documentation](/docs/kitex/tutorials/basic-feature/streamx)
2222

2323
2. Prutal - Protobuf's non-generated code serialisation library
24-
[Prutal](https://github.com/cloudwego/prutal) is officially open source, on par with Thrift's Frugal library, and the new version of Kitex integrates Prutal by default.
24+
[Prutal](https://github.com/cloudwego/prutal) is officially open source, on par with Thrift's [Frugal](https://github.com/cloudwego/frugal), and the new version of Kitex integrates Prutal by default.
2525

2626
Advantages:
2727

@@ -37,27 +37,27 @@ description: >
3737
1. **TTHeader Streaming**: Support interface-level Recv timeout control
3838
In addition to the existing Client level, this release of TTHeader Streaming supports interface-level Recv timeout configuration, making configuration more flexible.
3939

40-
User documentation: Kitex - StreamX 超时控制
40+
User documentation: [StreamX Timeout Control](/docs/kitex/tutorials/basic-feature/streamx/timeout-control)
4141

4242
2. Default Thrift transport protocol changed from Buffered to Framed
4343
This change can leverage FastCodec for better performance.
4444

4545
### **Others**
4646
1. Code Product Simplification
47-
- Kitex Tool would not generate the repeated verification code for Set data structure and the DeepEqual function for each structure by default.
47+
- Kitex Tool would not generate the repeated verification code for Set data structure and the ```DeepEqual``` function for each structure by default.
4848

49-
- If you only want to restore DeepEqual, add -thrift gen_deep_equal=true to the generation command.
49+
- If you only want to restore```DeepEqual```, add```-thrift gen_deep_equal=true```to the generation command.
5050

51-
- If you want to restore the repeated verification of Set, add -thrift validate_set=true, -thrift gen_deep_equal=true to the generation command.
51+
- If you want to restore the repeated verification of Set, add```-thrift validate_set=true, -thrift gen_deep_equal=true```to the generation command.
5252

5353
- Kitex Tool would not generate the Apache Codec related code by default.
5454

55-
- If you want to restore it, add -thrift no_default_serdes=false to the generation command.
55+
- If you want to restore it, add```-thrift no_default_serdes=false```to the generation command.
5656

5757
2. Go Supported Version Change
5858
Support version Go 1.19~1.24, the lowest supported version becomes Go 1.19.
5959

60-
if Go version is too low, there will be a prompt when compiling: note: module requires Go 1.19.
60+
if Go version is too low, there will be a prompt when compiling:```note: module requires Go 1.19```.
6161

6262
## **Full Change**
6363
### Feature
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
title: "StreamX timeout control"
3+
date: 2025-01-10
4+
weight: 5
5+
keywords: ["Stream Timeout Control Best Practices"]
6+
description: ""
7+
---
8+
9+
## Timeout Control Mechanism Supported by TTHeader Streaming
10+
### Recv Timeout
11+
Control timeout for every ```Recv```
12+
#### Client Level
13+
It will take effect for every Interface of this Client.
14+
15+
```
16+
import (
17+
"github.com/cloudwego/kitex/client"
18+
)
19+
20+
cli, err := NewClient("service", client.WithStreamOptions(client.WithStreamRecvTimeout(timeout)))
21+
```
22+
#### Interface Level(Kitex >= v0.13.0)
23+
It will take effect for single interface.
24+
25+
```
26+
import (
27+
"github.com/cloudwego/kitex/client/callopt/streamcall"
28+
)
29+
30+
cli, err := NewClient("service")
31+
// Calling one of the downstream streaming interfaces
32+
stream, err := cli.NewStream(ctx, streamcall.WithRecvTimeout(timeout))
33+
```

content/zh/blog/releases/Kitex/release-v0_13_0.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,41 +20,41 @@ description: >
2020

2121
已经使用 v0.12.* StreamX 用户会带来影响,在这里表示抱歉。
2222

23-
详见 [StreamX 用户文档](/docs/kitex/tutorials/basic-feature/streamx)
23+
详见 [StreamX 用户文档](/zh/docs/kitex/tutorials/basic-feature/streamx)
2424

2525
2. Prutal - Protobuf 的无生成代码序列化库
26-
Prutal 正式开源 (https://github.com/cloudwego/prutal),对标 Thrift 的 Frugal 库,新版本 Kitex 默认集成 Prutal。特点:
26+
[Prutal](https://github.com/cloudwego/prutal) 正式开源,对标 Thrift 的 [Frugal](https://github.com/cloudwego/frugal) 库,新版本 Kitex 默认集成 Prutal。特点:
2727

2828
- 产物体积最小化,只需生成结构体
2929

3030
- 使用与 Frugal 相似的反射优化,性能优于官方 Protobuf
3131

3232
- 兼容官方 Protobuf 及衍生版本的生成代码
3333

34-
详细信息参考 [Prutal](/docs/kitex/tutorials/code-gen/prutal)
34+
详细信息参考 [Prutal](/zh/docs/kitex/tutorials/code-gen/prutal)
3535

3636
### **功能/体验优化**
3737
1. TTHeader Streaming 支持配置接口级别 Recv 超时
3838
本版本 TTHeader Streaming 在原有的 Kitex Client 级别基础上,额外支持接口级别的 Recv 超时配置,配置更为灵活。
3939

40-
详见 Kitex - StreamX 超时控制
40+
详见 [StreamX 超时控制](/zh/docs/kitex/tutorials/basic/streamx/timeout-control)
4141

4242
2. Thrift 默认传输协议由 Buffered 改为 Framed
43-
可以利用 FastCodec 获得更高的编解码性能
43+
这个变更可以利用 FastCodec 以获得更高的编解码性能
4444

4545
### **其他**
4646
1. 产物简化
4747
- 默认不生成 Set 数据结构的重复校验代码与各结构体的 DeepEqual 函数
4848

49-
- 若只想恢复 DeepEqual,生成命令追加 -thrift gen_deep_equal=true
49+
- 若只想恢复 DeepEqual,生成命令追加```-thrift gen_deep_equal=true```
5050

51-
- 若想恢复 Set 的重复校验,生成命令追加 -thrift validate_set=true, -thrift gen_deep_equal=true
51+
- 若想恢复 Set 的重复校验,生成命令追加```-thrift validate_set=true, -thrift gen_deep_equal=true```
5252

5353
- 默认不生成 Apache Codec 相关代码
5454

55-
- 若想恢复,生成命令追加 -thrift no_default_serdes=false
55+
- 若想恢复,生成命令追加```-thrift no_default_serdes=false```
5656
2. Go 支持版本变化
57-
支持版本 Go 1.19~1.24,最低支持版本变为 Go 1.19,如果 Go 版本过低,编译时会有提示:note: module requires Go 1.19
57+
支持版本 Go 1.19~1.24,最低支持版本变为 Go 1.19,如果 Go 版本过低,编译时会有提示:```note: module requires Go 1.19```
5858

5959
## **详细变更**
6060
### Feature

content/zh/docs/kitex/Tutorials/basic-feature/streamx/Stream+FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "StreamX 流编程常见问题 QA"
33
date: 2025-01-13
4-
weight: 5
4+
weight: 6
55
keywords: ["流编程常见问题 QA"]
66
description: ""
77
---
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: "StreamX 流超时控制"
3+
date: 2025-01-10
4+
weight: 5
5+
keywords: ["流超时控制最佳实践"]
6+
description: ""
7+
---
8+
9+
## TTHeader Streaming 支持的超时机制
10+
### Recv Timeout
11+
对每次 Recv 进行超时控制。
12+
#### Client 级别
13+
这个 Client 下的所有接口都会生效。
14+
15+
```
16+
import (
17+
"github.com/cloudwego/kitex/client"
18+
)
19+
20+
cli, err := NewClient("service", client.WithStreamOptions(client.WithStreamRecvTimeout(timeout)))
21+
```
22+
#### 接口级别(Kitex >= v0.13.0)
23+
只针对单个接口生效。
24+
25+
```
26+
import (
27+
"github.com/cloudwego/kitex/client/callopt/streamcall"
28+
)
29+
30+
cli, err := NewClient("service")
31+
// 调用下游某个流式接口
32+
stream, err := cli.NewStream(ctx, streamcall.WithRecvTimeout(timeout))
33+
效果
34+
```

0 commit comments

Comments
 (0)