多路復用和超時控制
===
### 多路復用
```
select {
case ret := <-retCh1:
t.log(ret)
case ret := <-retCh2:
t.log(ret)
default:
fmt.print("err1")
}
```
那個通道里面有數據就會進入哪一個case
都沒有就會進入default
### 超時控制
```
select {
case ret := <-retCh:
t.Log(ret)
case <-time.After(time.Second)
t.log("time out")
}
```
- Hello World
- UDP
- UDP服務端
- UDP客戶端
- UDP廣播
- 錯誤處理
- 編寫好的異常處理
- panic和recover
- 并發編程
- Hello Goruntine
- 共享內存并發機制
- RWMutex
- CSP并發機制
- 多路復用和超時控制
- 通道關閉與廣播
- Context與任務的取消
- 只運行一次
- 按需任意任務完成
- 所有任務完成
- 補充:range channel注意實現
- 對象池
- sync.Pool臨時對象池
- 單元測試
- 表格測試法
- Banchmark
- BDD
- 反射
- 利用反射編寫靈活的代碼
- Struct Tag
- 萬能程序
- 常用架構模式
- Pipe-filter pattern
- Micro Kernel
- 性能分析
- 高性能代碼
- sync.MAP分析
- Concurrent Map
- GC友好的代碼
- Uber開發風格規范