Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChanOnlyOne ¶ added in v0.21.2
type ChanOnlyOne struct {
// contains filtered or unexported fields
}
func NewChanOnlyOne ¶ added in v0.21.2
func NewChanOnlyOne() *ChanOnlyOne
func (*ChanOnlyOne) Compute ¶ added in v0.21.2
func (c *ChanOnlyOne) Compute(k interface{}, fn func() (interface{}, error)) (interface{}, error)
type GetSetCache ¶
type GetSetCache struct {
// contains filtered or unexported fields
}
func (*GetSetCache) GetOrSet ¶
func (c *GetSetCache) GetOrSet(k interface{}, setFn SetFn) (v interface{}, err error)
type JitterFn ¶
func NewJitterFn ¶
type OnlyOne ¶ added in v0.21.2
type OnlyOne interface {
// Compute returns the value of calling fn(), but only calls fn once concurrently for
// each k.
Compute(k interface{}, fn func() (interface{}, error)) (interface{}, error)
}
OnlyOne ensures only one concurrent evaluation of a keyed expression.
Click to show internal directories.
Click to hide internal directories.