singleflight

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Group

type Group struct {
	// contains filtered or unexported fields
}

Group stores all function calls in it.

func NewGroup

func NewGroup(initialCap int) *Group

NewGroup returns a new Group with initialCap.

func (*Group) Call

func (g *Group) Call(key string, fn func() (interface{}, error)) (interface{}, error)

Call calls fn in singleflight mode and returns its result and error.

func (*Group) Delete

func (g *Group) Delete(key string)

Delete deletes the call of key so a new call can be called.

func (*Group) Reset added in v0.4.6

func (g *Group) Reset()

Reset resets group to initial status.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL