原书出处
Cloud Native Go (Matthew A. Titmus)
04 Cloud Native Patterns
When you do need to establish locks on all of the tables, it’s generally best to do so concurrently. Below we implement a Keys function using goroutines and our old friend sync.WaitGroup. func (m ShardedMap) Keys() []string { keys := make([]string, 0) // Create an empty keys slice wg := sync.WaitGroup{} // Create a wait
原书定位详情
来源:a19c7933-4eda-4176-aebd-30fe7e1ad292
正文位置:extracted/Cloud Native Go (Matthew A. Titmus)/_epub-src/OEBPS/ch04.xhtml
EPUB SHA-256:1154caa7b61465daf957a7d8f1350ef24ab5db9c850cab5987aae5bc74986022