Skip to content

Commit 7af9867

Browse files
committed
docs: update readme
1 parent fb0a177 commit 7af9867

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

readme-cn.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
以上实际都是在进行对输入数据进行处理最后输出清洗后的数据,针对数据处理有个非常经典的异步模式:生产者消费者模式。于是我们可以抽象一下数据批处理的生命周期,大致可以分为三个阶段:
3838

39-
![](https://cdn.learnku.com/uploads/images/202112/27/73865/Ct2DlYTVZW.png!large)
39+
![](https://raw.githubusercontent.com/zeromicro/zero-doc/main/doc/images/mapreduce-serial-cn.png)
4040

4141
1. 数据生产 generate
4242
2. 数据加工 mapper
@@ -46,12 +46,12 @@
4646

4747
再来思考一下不同阶段之间数据应该如何流转,既然不同阶段的数据处理都是由不同 goroutine 执行的,那么很自然的可以考虑采用 channel 来实现 goroutine 之间的通信。
4848

49-
![](https://cdn.learnku.com/uploads/images/202112/27/73865/JPazVK6rRf.png!large)
49+
![](https://raw.githubusercontent.com/zeromicro/zero-doc/main/doc/images/mapreduce-cn.png)
5050

5151

5252
如何实现随时终止流程呢?
5353

54-
很简单,goroutine 中监听一个全局的结束 channel 就行。
54+
`goroutine` 中监听一个全局的结束 `channel` 和调用方提供的 `ctx` 就行。
5555

5656
## 简单示例
5757

@@ -92,6 +92,8 @@ func main() {
9292
}
9393
```
9494

95+
更多示例:[https://github.com/zeromicro/zero-examples/tree/main/mapreduce](https://github.com/zeromicro/zero-examples/tree/main/mapreduce)
96+
9597
## 强烈推荐!
9698

9799
go-zero: [https://github.com/zeromicro/go-zero](https://github.com/zeromicro/go-zero)

readme.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Let's try to put ourselves in the author's shoes and sort out the possible busin
2323

2424
The above is actually processing the input data and finally outputting the cleaned data. There is a very classic asynchronous pattern for data processing: the producer-consumer pattern. So we can abstract the life cycle of data batch processing, which can be roughly divided into three phases.
2525

26-
![](https://cdn.learnku.com/uploads/images/202112/27/73865/aGKm4Lgw5r.png!large)
26+
![](https://raw.githubusercontent.com/zeromicro/zero-doc/main/doc/images/mapreduce-serial-en.png)
2727

2828
1. data production generate
2929
2. data processing mapper
@@ -33,11 +33,11 @@ Data producing is an indispensable stage, data processing and data aggregation a
3333

3434
Since different stages of data processing are performed by different goroutines, it is natural to consider the use of channel to achieve communication between goroutines.
3535

36-
![](https://cdn.learnku.com/uploads/images/202112/27/73865/qoucKqA8jH.png!large)
36+
![](https://raw.githubusercontent.com/zeromicro/zero-doc/main/doc/images/mapreduce-en.png)
3737

3838
How can I terminate the process at any time?
3939

40-
It's simple, just listen to a global end channel or the given context in the goroutine.
40+
It's simple, just receive from a channel or the given context in the goroutine.
4141

4242
## A simple example
4343

@@ -78,6 +78,8 @@ func main() {
7878
}
7979
```
8080

81+
More examples: [https://github.com/zeromicro/zero-examples/tree/main/mapreduce](https://github.com/zeromicro/zero-examples/tree/main/mapreduce)
82+
8183
## References
8284

8385
go-zero: [https://github.com/zeromicro/go-zero](https://github.com/zeromicro/go-zero)

0 commit comments

Comments
 (0)