Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Call ¶
type Call struct {
// contains filtered or unexported fields
}
singleflight Call, only call fn once it's a wrapper of sync.Once to store return values
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
a group of Call, use key to identify
func (*Group) Do ¶
func (g *Group) Do(key string, fn func() (interface{}, error), forgetAfter time.Duration) (interface{}, error)
about forgetAfter: - timer start before fn be called - only make sense if this call not hit cache, so you can't reset forget time - non-positive value means never forget
Click to show internal directories.
Click to hide internal directories.