singleflight

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: MIT 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[T any] struct {
	// contains filtered or unexported fields
}

func (*Group[T]) Do

func (g *Group[T]) Do(key string, fn func() (T, error)) (value T, err error, shared bool)

func (*Group[T]) DoChan

func (g *Group[T]) DoChan(key string, fn func() (T, error)) <-chan Result[T]

func (*Group[T]) Forget

func (g *Group[T]) Forget(key string)

type Result

type Result[T any] struct {
	Val    T
	Err    error
	Shared bool
}

Jump to

Keyboard shortcuts

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