Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4739916

Browse files
20220409
1 parent 0026990 commit 4739916

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎go-22/async_service_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import (
77
)
88

99
/*
10-
CSP并发机制 当成java的异步操作理解就行了
10+
CSP并发机制
11+
当成java的异步操作理解就行了,而CSP模式则是通过Channel进行通讯的,更松耦合一些
1112
12-
## Channel
13+
Channel(管道,像理解消息队列的管道一样理解就行了)
1314
- Channel是Go中的一个核心类型,你可以把它看成一个管道,通过它并发核心单元就可以发送或者接收数据进行通讯
1415
- 容量(capacity)代表Channel容纳的最多的元素的数量,代表Channel的缓存的大小。
1516
- 如果没有设置容量,或者容量设置为0, 说明Channel没有缓存,只有sender和receiver都准备好了后它们的通讯

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /