package
Version:
v0.0.0-...-15722f1
Opens a new window with list of versions in this module.
Published: Aug 30, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type SingleFlight struct {
}
使用 SingleFlight 对 Group 缓存未命中时的查询进行再封装,并发请求期间只有一个请求会以 goroutine 形式调用查询,
并发查询期间的所有其他请求均阻塞等待,当然我们也可以配置是否允许阻塞,给调用者更多选择
Source Files
¶
Click to show internal directories.
Click to hide internal directories.